mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 20:25:58 +01:00
gestures: Add gestures:workspace_swipe_min_fingers option (#6342)
When gestures:workspace_swipe_min_fingers is enabled, gestures:workspace_swipe_fingers is considered to be the minimum number of fingers required to swipe. This behavior is more similar to sway and macOS's default behavior. For example, this allows you to set workspace_swipe_fingers to 3, but swipe with 4 or more fingers instead of 3.
This commit is contained in:
parent
41e1147dfc
commit
40ce17bbbd
2 changed files with 6 additions and 4 deletions
|
@ -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});
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
#include "../../config/ConfigValue.hpp"
|
||||
|
||||
void CInputManager::onSwipeBegin(IPointer::SSwipeBeginEvent e) {
|
||||
static auto PSWIPE = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe");
|
||||
static auto PSWIPEFINGERS = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_fingers");
|
||||
static auto PSWIPENEW = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_create_new");
|
||||
static auto PSWIPE = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe");
|
||||
static auto PSWIPEFINGERS = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_fingers");
|
||||
static auto PSWIPEMINFINGERS = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_min_fingers");
|
||||
static auto PSWIPENEW = CConfigValue<Hyprlang::INT>("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;
|
||||
|
|
Loading…
Reference in a new issue