From 6a56d1e4d035824ea5dc94180994017346c5c067 Mon Sep 17 00:00:00 2001 From: devil-may-c0de <122350426+devil-may-c0de@users.noreply.github.com> Date: Mon, 16 Jan 2023 20:04:10 +0000 Subject: [PATCH] change placement of isSwitchingToPrevious (#1388) fixes #1218, but doesn't break functionality of allow_workspace_cycles. --- src/managers/KeybindManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 3546d0283..1fe4b729a 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -669,13 +669,13 @@ void CKeybindManager::changeworkspace(std::string args) { 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 + isSwitchingToPrevious = true; } } else { workspaceToChangeTo = getWorkspaceIDFromString(args, workspaceName); @@ -702,13 +702,13 @@ void CKeybindManager::changeworkspace(std::string args) { 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 + isSwitchingToPrevious = true; } else if (PCURRENTWORKSPACE && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal) return;