diff options
author | MightyPlaza <[email protected]> | 2024-08-01 09:43:32 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-08-01 11:43:32 +0200 |
commit | 95959789b7667172b2b2f37f78fe96ac196e9cd3 (patch) | |
tree | d3245eab24fdd4f1e9b1bae3785e22548e0b1417 | |
parent | 8c02b3c267198541dd03601e4c7ff7d870197728 (diff) | |
download | Hyprland-95959789b7667172b2b2f37f78fe96ac196e9cd3.tar.gz Hyprland-95959789b7667172b2b2f37f78fe96ac196e9cd3.zip |
keybinds: allow toggling fullscreenstate (#7128)
modified: src/managers/KeybindManager.cpp
-rw-r--r-- | src/managers/KeybindManager.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 33b07351..9984fe40 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1174,9 +1174,13 @@ void CKeybindManager::fullscreenStateActive(std::string args) { clientMode = std::stoi(ARGS[1]); } catch (std::exception& e) { clientMode = -1; } - g_pCompositor->setWindowFullscreenState(PWINDOW, - sFullscreenState{.internal = (internalMode != -1 ? (eFullscreenMode)internalMode : PWINDOW->m_sFullscreenState.internal), - .client = (clientMode != -1 ? (eFullscreenMode)clientMode : PWINDOW->m_sFullscreenState.client)}); + const sFullscreenState STATE = sFullscreenState{.internal = (internalMode != -1 ? (eFullscreenMode)internalMode : PWINDOW->m_sFullscreenState.internal), + .client = (clientMode != -1 ? (eFullscreenMode)clientMode : PWINDOW->m_sFullscreenState.client)}; + + if (PWINDOW->m_sFullscreenState.internal == STATE.internal && PWINDOW->m_sFullscreenState.client == STATE.client) + g_pCompositor->setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = FSMODE_NONE, .client = FSMODE_NONE}); + else + g_pCompositor->setWindowFullscreenState(PWINDOW, STATE); } void CKeybindManager::moveActiveToWorkspace(std::string args) { |