From 4c9c5f9fd51a34164a55541d7f74f27c732a6bab Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 24 Feb 2022 18:11:45 +0100 Subject: [PATCH] inputmethod: fix placing the virtual keyboard at the bottom We should use the output area as the margin size as where to position rather than the panelSize. This ensures that the keyboard ends up in the right place right above the panels. --- src/inputpanelv1client.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/inputpanelv1client.cpp b/src/inputpanelv1client.cpp index 7ec7c1df38..fafc6d1019 100644 --- a/src/inputpanelv1client.cpp +++ b/src/inputpanelv1client.cpp @@ -81,22 +81,24 @@ void KWin::InputPanelV1Client::reposition() } QRect availableArea; + QRect outputArea; if (m_output) { + outputArea = m_output->geometry(); if (waylandServer()->isScreenLocked()) { - availableArea = m_output->geometry(); + availableArea = outputArea; } else { availableArea = workspace()->clientArea(MaximizeArea, this, m_output); } } else { availableArea = workspace()->clientArea(MaximizeArea, this); + outputArea = workspace()->clientArea(FullScreenArea, this); } panelSize = panelSize.boundedTo(availableArea.size()); QRect geo(availableArea.topLeft(), panelSize); - geo.translate((availableArea.width() - panelSize.width())/2, availableArea.height() - panelSize.height()); + geo.translate((availableArea.width() - panelSize.width())/2, availableArea.height() - outputArea.height()); moveResize(geo); - } break; case Overlay: { auto textInputSurface = waylandServer()->seat()->focusedTextInputSurface();