summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorstaz <74452129+alyanser@users.noreply.github.com>2023-06-05 12:44:13 +0500
committerGitHub <noreply@github.com>2023-06-05 09:44:13 +0200
commite4e6ddb075605c3b3b48654de459796d72035f92 (patch)
tree73eb4d4a0132b32ee12439ee969f67700ba70608 /src/managers/KeybindManager.cpp
parent4ef684f6153c167afd6e84c01a814f46d9f287ae (diff)
Make movetoworkspace register previous workspace (#2436)
* Make movetoworkspace register previous workspace * style: no braces + format with clang-format
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 6efca86c..9050374c 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -881,9 +881,10 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) {
return;
}
- auto pWorkspace = g_pCompositor->getWorkspaceByID(WORKSPACEID);
- CMonitor* pMonitor = nullptr;
- const auto POLDWS = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID);
+ auto pWorkspace = g_pCompositor->getWorkspaceByID(WORKSPACEID);
+ CMonitor* pMonitor = nullptr;
+ const auto POLDWS = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID);
+ static auto* const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue;
g_pHyprRenderer->damageWindow(PWINDOW);
@@ -903,6 +904,9 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) {
g_pCompositor->focusWindow(PWINDOW);
g_pCompositor->warpCursorTo(PWINDOW->middle());
+
+ if (*PALLOWWORKSPACECYCLES)
+ pWorkspace->m_sPrevWorkspace = {POLDWS->m_iID, POLDWS->m_szName};
}
void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) {