From babb9c07b045e21b5549cdcc3096d677e9db35b3 Mon Sep 17 00:00:00 2001 From: scorpion-26 Date: Thu, 11 Jan 2024 19:22:40 +0100 Subject: [PATCH] swipe: Prevent hiding current workspace when swiping (#4417) When workspace_swipe_use_r is enabled, swiping from WS 1 to a non-empty WS 2 would hide WS 1 (Similar effect to issue #4076). This is caused by a faulty check which doesn't consider, that workspaceIDLeft could be the current workspace. This bug is only a problem for r, because m wraps around on WS 1 m-1, whereas r stays on WS 1. --- src/managers/input/Swipe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp index f345e4f5..38ec8aa2 100644 --- a/src/managers/input/Swipe.cpp +++ b/src/managers/input/Swipe.cpp @@ -265,7 +265,7 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) { PWORKSPACE->m_bForceRendering = true; PWORKSPACE->m_fAlpha.setValueAndWarp(1.f); - if (workspaceIDLeft != workspaceIDRight) { + if (workspaceIDLeft != workspaceIDRight && workspaceIDRight != m_sActiveSwipe.pWorkspaceBegin->m_iID) { const auto PWORKSPACER = g_pCompositor->getWorkspaceByID(workspaceIDRight); if (PWORKSPACER) { @@ -305,7 +305,7 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) { PWORKSPACE->m_bForceRendering = true; PWORKSPACE->m_fAlpha.setValueAndWarp(1.f); - if (workspaceIDLeft != workspaceIDRight) { + if (workspaceIDLeft != workspaceIDRight && workspaceIDLeft != m_sActiveSwipe.pWorkspaceBegin->m_iID) { const auto PWORKSPACEL = g_pCompositor->getWorkspaceByID(workspaceIDLeft); if (PWORKSPACEL) {