diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-06 20:40:58 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-06 20:40:58 +0100 |
| commit | b4a8efc1a76d4f4e6485fdf39796cb0eb2cf80fd (patch) | |
| tree | 1ee893993189271c40525a10bebba9d880f46d5c /src/managers/KeybindManager.cpp | |
| parent | 9480c0fb90caf4c55615adbf68bf8a92f8db5d0b (diff) | |
fix naming when workspace back and forth
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 89dfe3f1..ba297540 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -643,18 +643,24 @@ 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; - // 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; - } + workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID; + + if (PPREVWORKSPACE) + workspaceName = PPREVWORKSPACE->m_szName; + else + workspaceName = std::to_string(workspaceToChangeTo); + + 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; + } else if (PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal) return; |
