From 40b8637ab87e254bcccab35c2a68d211515fe74f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20F=C3=A1bi=C3=A1n?= Date: Thu, 7 Mar 2024 18:28:02 +0100 Subject: [PATCH] xdgshellwindow: Always update window position and size along all axes when fully miximizing window BUG: 482086 --- src/xdgshellwindow.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index c361c62a92..215d7d976d 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -1519,15 +1519,14 @@ void XdgToplevelWindow::maximize(MaximizeMode mode) setGeometryRestore(savedGeometry); } - const MaximizeMode delta = m_requestedMaximizeMode ^ oldMode; QRectF geometry = oldGeometry; - if (delta & MaximizeHorizontal) { - if (m_requestedMaximizeMode & MaximizeHorizontal) { - // Stretch the window vertically to fit the size of the maximize area. - geometry.setX(clientArea.x()); - geometry.setWidth(clientArea.width()); - } else if (geometryRestore().isValid()) { + if (m_requestedMaximizeMode & MaximizeHorizontal) { + // Stretch the window vertically to fit the size of the maximize area. + geometry.setX(clientArea.x()); + geometry.setWidth(clientArea.width()); + } else if (oldMode & MaximizeHorizontal) { + if (geometryRestore().isValid()) { // The window is no longer maximized horizontally and the saved geometry is valid. geometry.setX(geometryRestore().x()); geometry.setWidth(geometryRestore().width()); @@ -1540,12 +1539,12 @@ void XdgToplevelWindow::maximize(MaximizeMode mode) } } - if (delta & MaximizeVertical) { - if (m_requestedMaximizeMode & MaximizeVertical) { - // Stretch the window horizontally to fit the size of the maximize area. - geometry.setY(clientArea.y()); - geometry.setHeight(clientArea.height()); - } else if (geometryRestore().isValid()) { + if (m_requestedMaximizeMode & MaximizeVertical) { + // Stretch the window horizontally to fit the size of the maximize area. + geometry.setY(clientArea.y()); + geometry.setHeight(clientArea.height()); + } else if (oldMode & MaximizeVertical) { + if (geometryRestore().isValid()) { // The window is no longer maximized vertically and the saved geometry is valid. geometry.setY(geometryRestore().y()); geometry.setHeight(geometryRestore().height());