From 7ffa7c48e56401e3a8f3ca978ad94bf7fde560dd Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 16 Sep 2021 18:09:01 +0200 Subject: [PATCH] wayland inputmethods: If maximized, also restore to the available area The stored geometry is irrelevant in the window is maximized. This is especially relevant if we: * open a virtual keyboard * rotate the display (then it looks ok as it was already addressed) * then remove the keyboard. At that point we want to reset to the available area rather than the previous. --- src/abstract_client.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index 9c53729d1b..61f40adf00 100644 --- a/src/abstract_client.cpp +++ b/src/abstract_client.cpp @@ -2635,7 +2635,9 @@ void AbstractClient::setVirtualKeyboardGeometry(const QRect &geo) { // No keyboard anymore if (geo.isEmpty() && !m_keyboardGeometryRestore.isEmpty()) { - moveResize(m_keyboardGeometryRestore); + const QRect availableArea = workspace()->clientArea(MaximizeArea, this); + QRect newWindowGeometry = (maximizeMode() & MaximizeHorizontal) ? availableArea : m_keyboardGeometryRestore; + moveResize(newWindowGeometry); m_keyboardGeometryRestore = QRect(); } else if (geo.isEmpty()) { return;