summaryrefslogtreecommitdiff
path: root/src/managers/input/Swipe.cpp
diff options
context:
space:
mode:
authorDarksome <dev@darkso.me>2022-07-21 19:18:03 +0300
committerDarksome <dev@darkso.me>2022-07-21 19:18:03 +0300
commiteb8a1939e6dddaaf81f6b623d1c657b801978487 (patch)
treed62d4ca30d4114fe2e2745e36907b65ac4be20af /src/managers/input/Swipe.cpp
parent68cfc1a496f556f360c032651b75d33ddb576517 (diff)
parent7f660fed0d4a8133ccde21c3e092dbc8c6e08c60 (diff)
Merge upstream
Diffstat (limited to 'src/managers/input/Swipe.cpp')
-rw-r--r--src/managers/input/Swipe.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index 98f31945..74783f42 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -4,8 +4,9 @@
void CInputManager::onSwipeBegin(wlr_pointer_swipe_begin_event* e) {
static auto *const PSWIPE = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe")->intValue;
+ static auto *const PSWIPEFINGERS = &g_pConfigManager->getConfigValuePtr("gestures:workspace_swipe_fingers")->intValue;
- if (e->fingers < 3 || *PSWIPE == 0)
+ if (e->fingers != *PSWIPEFINGERS|| *PSWIPE == 0)
return;
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
@@ -58,6 +59,10 @@ void CInputManager::onSwipeEnd(wlr_pointer_swipe_end_event* e) {
PWORKSPACEL->m_vRenderOffset.setValue(RENDEROFFSET);
PWORKSPACEL->m_fAlpha.setValueAndWarp(255.f);
+ m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValue(RENDEROFFSETMIDDLE);
+ m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset = Vector2D(m_sActiveSwipe.pMonitor->vecSize.x, 0);
+ m_sActiveSwipe.pWorkspaceBegin->m_fAlpha.setValueAndWarp(255.f);
+
Debug::log(LOG, "Ended swipe to the left");
} else {
// switch to right
@@ -68,12 +73,13 @@ void CInputManager::onSwipeEnd(wlr_pointer_swipe_end_event* e) {
PWORKSPACER->m_vRenderOffset.setValue(RENDEROFFSET);
PWORKSPACER->m_fAlpha.setValueAndWarp(255.f);
+ m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValue(RENDEROFFSETMIDDLE);
+ m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset = Vector2D(-m_sActiveSwipe.pMonitor->vecSize.x, 0);
+ m_sActiveSwipe.pWorkspaceBegin->m_fAlpha.setValueAndWarp(255.f);
+
Debug::log(LOG, "Ended swipe to the right");
}
- m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValue(RENDEROFFSETMIDDLE);
- m_sActiveSwipe.pWorkspaceBegin->m_fAlpha.setValueAndWarp(255.f);
-
PWORKSPACEL->m_bForceRendering = false;
PWORKSPACER->m_bForceRendering = false;
m_sActiveSwipe.pWorkspaceBegin->m_bForceRendering = false;