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.
This commit is contained in:
jmanc3 2025-09-01 15:44:41 -05:00 committed by GitHub
parent 641d85b14e
commit 8a64168a43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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