diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-09-17 12:10:06 +0100 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-09-17 12:10:06 +0100 |
| commit | 151e013241e29d0f4f2619db17257343503e20ea (patch) | |
| tree | 6f17dadee2a2915fa8c8159e5e99f8c54d17507a /src/managers/KeybindManager.cpp | |
| parent | fa2d81b649aaccd936193ac4341431c0836a321b (diff) | |
fix refocus on same workspace
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index a7205398..bf899a7b 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -575,9 +575,9 @@ void CKeybindManager::changeworkspace(std::string args) { // Workspace_back_and_forth being enabled means that an attempt to switch to // the current workspace will instead switch to the previous. - const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID( - g_pCompositor->m_pLastMonitor->activeWorkspace); + const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace); static auto *const PBACKANDFORTH = &g_pConfigManager->getConfigValuePtr("binds:workspace_back_and_forth")->intValue; + if (*PBACKANDFORTH && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && PCURRENTWORKSPACE->m_iPrevWorkspaceID != -1 && !internal) { workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID; @@ -588,7 +588,9 @@ void CKeybindManager::changeworkspace(std::string args) { static auto *const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue; if (!*PALLOWWORKSPACECYCLES) PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1; - } + + } else if (PCURRENTWORKSPACE->m_iID == workspaceToChangeTo) + return; // remove constraints g_pInputManager->unconstrainMouse(); |
