diff options
author | vaxerski <[email protected]> | 2022-10-06 20:18:49 +0100 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-10-06 20:18:49 +0100 |
commit | 9480c0fb90caf4c55615adbf68bf8a92f8db5d0b (patch) | |
tree | 6ccb8e874e4e0347e08abdc46be7dc10fb6814f6 | |
parent | f901c60da534035f86ce47920416cedc56240ca4 (diff) | |
download | Hyprland-9480c0fb90caf4c55615adbf68bf8a92f8db5d0b.tar.gz Hyprland-9480c0fb90caf4c55615adbf68bf8a92f8db5d0b.zip |
fix workspace previous with multi-mon ws moves
-rw-r--r-- | src/managers/KeybindManager.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 7e539149..89dfe3f1 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -643,16 +643,18 @@ void CKeybindManager::changeworkspace(std::string args) { static auto *const PBACKANDFORTH = &g_pConfigManager->getConfigValuePtr("binds:workspace_back_and_forth")->intValue; if (*PBACKANDFORTH && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && PCURRENTWORKSPACE->m_iPrevWorkspaceID != -1 && !internal) { + + const auto PPREVWORKSPACE = g_pCompositor->getWorkspaceByID(PCURRENTWORKSPACE->m_iPrevWorkspaceID); + if (!PPREVWORKSPACE || PPREVWORKSPACE->m_iMonitorID == PCURRENTWORKSPACE->m_iMonitorID) { + workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID; + isSwitchingToPrevious = true; - workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID; - isSwitchingToPrevious = true; - - // If the previous workspace ID isn't reset, cycles can form when continually going - // to the previous workspace again and again. - static auto *const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue; - if (!*PALLOWWORKSPACECYCLES) - PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1; - + // If the previous workspace ID isn't reset, cycles can form when continually going + // to the previous workspace again and again. + static auto* const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue; + if (!*PALLOWWORKSPACECYCLES) + PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1; + } } else if (PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal) return; |