From 8a64168a43f7d50810f428af0b34013f796ca2c8 Mon Sep 17 00:00:00 2001 From: jmanc3 Date: Mon, 1 Sep 2025 15:44:41 -0500 Subject: [PATCH] window: treat maximize as toggle request (#11564) Breaks the spec, but fixes a few issues due to how we always communicate to the apps that they are maximized in xdg_shell. --- src/desktop/Window.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index 03914581..3c952005 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1466,8 +1466,12 @@ void CWindow::onUpdateState() { } if (requestsMX.has_value() && !(m_suppressedEvents & SUPPRESS_MAXIMIZE)) { - if (m_isMapped) - g_pCompositor->changeWindowFullscreenModeClient(m_self.lock(), FSMODE_MAXIMIZED, requestsMX.value()); + if (m_isMapped) { + auto window = m_self.lock(); + auto state = sc(window->m_fullscreenState.client); + bool maximized = (state & sc(FSMODE_MAXIMIZED)) != 0; + g_pCompositor->changeWindowFullscreenModeClient(window, FSMODE_MAXIMIZED, !maximized); + } } }