keybinds: Fix fullscreenState toggling behaviour (#7288)

* Update fullscreen state dispatcher behaviour

* Change syncFullscreen default to false

* Revert all changes

* Modify fullscreenstate dispatcher toggle behaviour

* Update syncFullscreen according to state

* Update syncFullscreen before setting fullscreen state
This commit is contained in:
Kyle 2024-08-12 13:41:26 -04:00 committed by GitHub
parent 3fa6db1e7a
commit c7b72790bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1166,6 +1166,8 @@ void CKeybindManager::fullscreenStateActive(std::string args) {
if (!PWINDOW) if (!PWINDOW)
return; return;
PWINDOW->m_sWindowData.syncFullscreen = CWindowOverridableVar(false, PRIORITY_SET_PROP);
int internalMode, clientMode; int internalMode, clientMode;
try { try {
internalMode = std::stoi(ARGS[0]); internalMode = std::stoi(ARGS[0]);
@ -1184,18 +1186,15 @@ void CKeybindManager::fullscreenStateActive(std::string args) {
} }
if (internalMode != -1 && clientMode == -1 && PWINDOW->m_sFullscreenState.internal == STATE.internal) { if (internalMode != -1 && clientMode == -1 && PWINDOW->m_sFullscreenState.internal == STATE.internal) {
g_pCompositor->setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = PWINDOW->m_sFullscreenState.client, .client = PWINDOW->m_sFullscreenState.client}); g_pCompositor->setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = FSMODE_NONE, .client = PWINDOW->m_sFullscreenState.client});
PWINDOW->m_sWindowData.syncFullscreen = CWindowOverridableVar(true, PRIORITY_SET_PROP);
return; return;
} }
if (internalMode == -1 && clientMode != -1 && PWINDOW->m_sFullscreenState.client == STATE.client) { if (internalMode == -1 && clientMode != -1 && PWINDOW->m_sFullscreenState.client == STATE.client) {
g_pCompositor->setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = PWINDOW->m_sFullscreenState.internal, .client = PWINDOW->m_sFullscreenState.internal}); g_pCompositor->setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = PWINDOW->m_sFullscreenState.internal, .client = FSMODE_NONE});
PWINDOW->m_sWindowData.syncFullscreen = CWindowOverridableVar(true, PRIORITY_SET_PROP);
return; return;
} }
PWINDOW->m_sWindowData.syncFullscreen = CWindowOverridableVar(false, PRIORITY_SET_PROP);
g_pCompositor->setWindowFullscreenState(PWINDOW, STATE); g_pCompositor->setWindowFullscreenState(PWINDOW, STATE);
} }