change placement of isSwitchingToPrevious (#1388)

fixes #1218, but doesn't break functionality of allow_workspace_cycles.
This commit is contained in:
devil-may-c0de 2023-01-16 20:04:10 +00:00 committed by GitHub
parent 589046ecf7
commit 6a56d1e4d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -669,13 +669,13 @@ void CKeybindManager::changeworkspace(std::string args) {
else else
workspaceName = std::to_string(workspaceToChangeTo); workspaceName = std::to_string(workspaceToChangeTo);
isSwitchingToPrevious = true;
// If the previous workspace ID isn't reset, cycles can form when continually going // If the previous workspace ID isn't reset, cycles can form when continually going
// to the previous workspace again and again. // to the previous workspace again and again.
static auto* const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue; static auto* const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue;
if (!*PALLOWWORKSPACECYCLES) if (!*PALLOWWORKSPACECYCLES)
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1; PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
else
isSwitchingToPrevious = true;
} }
} else { } else {
workspaceToChangeTo = getWorkspaceIDFromString(args, workspaceName); workspaceToChangeTo = getWorkspaceIDFromString(args, workspaceName);
@ -702,13 +702,13 @@ void CKeybindManager::changeworkspace(std::string args) {
else else
workspaceName = std::to_string(workspaceToChangeTo); workspaceName = std::to_string(workspaceToChangeTo);
isSwitchingToPrevious = true;
// If the previous workspace ID isn't reset, cycles can form when continually going // If the previous workspace ID isn't reset, cycles can form when continually going
// to the previous workspace again and again. // to the previous workspace again and again.
static auto* const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue; static auto* const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue;
if (!*PALLOWWORKSPACECYCLES) if (!*PALLOWWORKSPACECYCLES)
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1; PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
else
isSwitchingToPrevious = true;
} else if (PCURRENTWORKSPACE && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal) } else if (PCURRENTWORKSPACE && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal)
return; return;