From 1ba600ca23706683ddd4035ce12cace43b911980 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 19 Jul 2022 18:35:24 +0200 Subject: [PATCH] added workspace swipe fingers --- src/config/ConfigManager.cpp | 1 + src/managers/input/Swipe.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 8990e2517..81e63b1b1 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -126,6 +126,7 @@ void CConfigManager::setDefaultVars() { configValues["input:touchpad:drag_lock"].intValue = 0; configValues["gestures:workspace_swipe"].intValue = 0; + configValues["gestures:workspace_swipe_fingers"].intValue = 3; configValues["gestures:workspace_swipe_distance"].intValue = 300; configValues["gestures:workspace_swipe_invert"].intValue = 1; configValues["gestures:workspace_swipe_min_speed_to_force"].intValue = 30; diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp index d606dc98f..74783f42d 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);