layershell: Support virtual keyboards
Resize layershell-based clients to adapt to the keyboard when it appears.
This commit is contained in:
parent
b3ddb11b7c
commit
ee181ef7a5
3 changed files with 16 additions and 0 deletions
|
@ -272,4 +272,14 @@ void LayerShellV1Client::handleOutputDestroyed()
|
|||
destroyClient();
|
||||
}
|
||||
|
||||
void LayerShellV1Client::setVirtualKeyboardGeometry(const QRect &geo)
|
||||
{
|
||||
if (m_virtualKeyboardGeometry == geo) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_virtualKeyboardGeometry = geo;
|
||||
scheduleRearrange();
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
bool hasStrut() const override;
|
||||
void destroyClient() override;
|
||||
void closeWindow() override;
|
||||
void setVirtualKeyboardGeometry(const QRect &geo) override;
|
||||
|
||||
protected:
|
||||
Layer belongsToLayer() const override;
|
||||
|
|
|
@ -148,6 +148,11 @@ static void rearrangeLayer(const QList<LayerShellV1Client *> &clients, QRect *wo
|
|||
geometry.translate(0, -shellSurface->bottomMargin());
|
||||
}
|
||||
|
||||
// Move the window's bottom if its virtual keyboard is overlapping it
|
||||
if (shellSurface->exclusiveZone() >= 0 && !client->virtualKeyboardGeometry().isEmpty() && geometry.bottom() > client->virtualKeyboardGeometry().top()) {
|
||||
geometry.setBottom(client->virtualKeyboardGeometry().top());
|
||||
}
|
||||
|
||||
if (geometry.isValid()) {
|
||||
client->setFrameGeometry(geometry);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue