diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-10-13 15:16:39 +0100 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-10-13 15:17:16 +0100 |
| commit | eb3c132fc52a9c02645527ec7b05b09b23112460 (patch) | |
| tree | fde92633cd92abcc70af78d665e47149c939a0c3 /src/managers/KeybindManager.cpp | |
| parent | 170def35d79210f9124cdfd7da563d5d384dcae9 (diff) | |
set workspace name in previous
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index ba297540..9095ccf8 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -610,16 +610,20 @@ void CKeybindManager::changeworkspace(std::string args) { internal = true; } else if (args.find("previous") == 0) { - const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID( - g_pCompositor->m_pLastMonitor->activeWorkspace); + const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace); // Do nothing if there's no previous workspace, otherwise switch to it. if (PCURRENTWORKSPACE->m_iPrevWorkspaceID == -1) { Debug::log(LOG, "No previous workspace to change to"); return; - } - else { + } else { workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID; + + if (const auto PWORKSPACETOCHANGETO = g_pCompositor->getWorkspaceByID(workspaceToChangeTo); PWORKSPACETOCHANGETO) + workspaceName = PWORKSPACETOCHANGETO->m_szName; + else + workspaceName = std::to_string(workspaceToChangeTo); + isSwitchingToPrevious = true; // If the previous workspace ID isn't reset, cycles can form when continually going |
