summaryrefslogtreecommitdiff
path: root/src/desktop/Window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/desktop/Window.cpp')
-rw-r--r--src/desktop/Window.cpp8
1 files 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<int8_t>(window->m_fullscreenState.client);
+ bool maximized = (state & sc<uint8_t>(FSMODE_MAXIMIZED)) != 0;
+ g_pCompositor->changeWindowFullscreenModeClient(window, FSMODE_MAXIMIZED, !maximized);
+ }
}
}