summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikolai Nechaev <nikolay_nechaev@mail.ru>2025-12-06 05:43:30 +0900
committerGitHub <noreply@github.com>2025-12-05 20:43:30 +0000
commit222dbe99d0d2d8a61f3b3202f8ef1794b0b081b7 (patch)
tree1c78deebddc7b7e8a777d6251bda73a886f796fc /src
parentebe74be75a86edd69340c44a910108c84ae38dce (diff)
keybinds: fix previous workspace remembering (#12399)
* swipe: Fix previous workspace remembering in workspace gesture Fixes a bug that previous workspace does not exist after swiping to a workspace * tests: Test that `workspace previous` works after workspace gesture * moveActiveToWorkspace: remember previous workspace unconditionally
Diffstat (limited to 'src')
-rw-r--r--src/managers/KeybindManager.cpp10
-rw-r--r--src/managers/input/UnifiedWorkspaceSwipeGesture.cpp4
2 files changed, 6 insertions, 8 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index a6d7a7e3..46f97d1f 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -1391,10 +1391,9 @@ SDispatchResult CKeybindManager::moveActiveToWorkspace(std::string args) {
return {.success = false, .error = "Not moving to workspace because it didn't change."};
}
- auto pWorkspace = g_pCompositor->getWorkspaceByID(WORKSPACEID);
- PHLMONITOR pMonitor = nullptr;
- const auto POLDWS = PWINDOW->m_workspace;
- static auto PALLOWWORKSPACECYCLES = CConfigValue<Hyprlang::INT>("binds:allow_workspace_cycles");
+ auto pWorkspace = g_pCompositor->getWorkspaceByID(WORKSPACEID);
+ PHLMONITOR pMonitor = nullptr;
+ const auto POLDWS = PWINDOW->m_workspace;
updateRelativeCursorCoords();
@@ -1419,8 +1418,7 @@ SDispatchResult CKeybindManager::moveActiveToWorkspace(std::string args) {
else if (POLDWS->m_isSpecialWorkspace)
POLDWS->m_monitor.lock()->setSpecialWorkspace(nullptr);
- if (*PALLOWWORKSPACECYCLES)
- pWorkspace->rememberPrevWorkspace(POLDWS);
+ pWorkspace->rememberPrevWorkspace(POLDWS);
pMonitor->changeWorkspace(pWorkspace);
diff --git a/src/managers/input/UnifiedWorkspaceSwipeGesture.cpp b/src/managers/input/UnifiedWorkspaceSwipeGesture.cpp
index 6dae1e63..68ee5b9b 100644
--- a/src/managers/input/UnifiedWorkspaceSwipeGesture.cpp
+++ b/src/managers/input/UnifiedWorkspaceSwipeGesture.cpp
@@ -292,7 +292,7 @@ void CUnifiedWorkspaceSwipeGesture::end() {
pSwitchedTo = PWORKSPACER;
}
- m_workspaceBegin->rememberPrevWorkspace(pSwitchedTo);
+ pSwitchedTo->rememberPrevWorkspace(m_workspaceBegin);
g_pHyprRenderer->damageMonitor(m_monitor.lock());
@@ -311,4 +311,4 @@ void CUnifiedWorkspaceSwipeGesture::end() {
for (auto const& ls : Desktop::focusState()->monitor()->m_layerSurfaceLayers[2]) {
*ls->m_alpha = pSwitchedTo->m_hasFullscreenWindow && pSwitchedTo->m_fullscreenMode == FSMODE_FULLSCREEN ? 0.f : 1.f;
}
-} \ No newline at end of file
+}