diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 6db920ea..e10522d9 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -500,6 +500,7 @@ CConfigManager::CConfigManager() { m_pConfig->addConfigValue("gestures:workspace_swipe", Hyprlang::INT{0}); m_pConfig->addConfigValue("gestures:workspace_swipe_fingers", Hyprlang::INT{3}); + m_pConfig->addConfigValue("gestures:workspace_swipe_min_fingers", Hyprlang::INT{0}); m_pConfig->addConfigValue("gestures:workspace_swipe_distance", Hyprlang::INT{300}); m_pConfig->addConfigValue("gestures:workspace_swipe_invert", Hyprlang::INT{1}); m_pConfig->addConfigValue("gestures:workspace_swipe_min_speed_to_force", Hyprlang::INT{30}); diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp index 44623671..a605fea7 100644 --- a/src/managers/input/Swipe.cpp +++ b/src/managers/input/Swipe.cpp @@ -3,13 +3,14 @@ #include "../../config/ConfigValue.hpp" void CInputManager::onSwipeBegin(IPointer::SSwipeBeginEvent e) { - static auto PSWIPE = CConfigValue("gestures:workspace_swipe"); - static auto PSWIPEFINGERS = CConfigValue("gestures:workspace_swipe_fingers"); - static auto PSWIPENEW = CConfigValue("gestures:workspace_swipe_create_new"); + static auto PSWIPE = CConfigValue("gestures:workspace_swipe"); + static auto PSWIPEFINGERS = CConfigValue("gestures:workspace_swipe_fingers"); + static auto PSWIPEMINFINGERS = CConfigValue("gestures:workspace_swipe_min_fingers"); + static auto PSWIPENEW = CConfigValue("gestures:workspace_swipe_create_new"); EMIT_HOOK_EVENT_CANCELLABLE("swipeBegin", e); - if (e.fingers != *PSWIPEFINGERS || *PSWIPE == 0 || g_pSessionLockManager->isSessionLocked()) + if ((!*PSWIPEMINFINGERS && e.fingers != *PSWIPEFINGERS) || (*PSWIPEMINFINGERS && e.fingers < *PSWIPEFINGERS) || *PSWIPE == 0 || g_pSessionLockManager->isSessionLocked()) return; int onMonitor = 0;