Commit ee181ef7 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

layershell: Support virtual keyboards

Resize layershell-based clients to adapt to the keyboard when it
appears.
parent b3ddb11b
......@@ -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 {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment