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.
This commit is contained in:
Aleix Pol 2022-02-24 18:11:45 +01:00
parent cf6cc51651
commit 4c9c5f9fd5

View file

@ -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();