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.
This commit is contained in:
Aleix Pol 2021-09-16 18:09:01 +02:00 committed by Aleix Pol Gonzalez
parent 08d3ceb024
commit 7ffa7c48e5

View file

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