From df956a0f6fbcfd7397b2d7b86883c0936c7795ec Mon Sep 17 00:00:00 2001 From: Mike Will Date: Fri, 6 Dec 2024 01:16:58 -0500 Subject: windowrules: add rules for mouse and touchpad scroll factors (#8655) --- src/managers/input/InputManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 6883717c..d1eb7c4c 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -761,7 +761,8 @@ void CInputManager::onMouseWheel(IPointer::SAxisEvent e) { static auto PEMULATEDISCRETE = CConfigValue("input:emulate_discrete_scroll"); static auto PFOLLOWMOUSE = CConfigValue("input:follow_mouse"); - auto factor = (*PTOUCHPADSCROLLFACTOR <= 0.f || e.source == WL_POINTER_AXIS_SOURCE_FINGER ? *PTOUCHPADSCROLLFACTOR : *PINPUTSCROLLFACTOR); + const bool ISTOUCHPADSCROLL = *PTOUCHPADSCROLLFACTOR <= 0.f || e.source == WL_POINTER_AXIS_SOURCE_FINGER; + auto factor = ISTOUCHPADSCROLL ? *PTOUCHPADSCROLLFACTOR : *PINPUTSCROLLFACTOR; const auto EMAP = std::unordered_map{{"event", e}}; EMIT_HOOK_EVENT_CANCELLABLE("mouseAxis", EMAP); @@ -803,6 +804,7 @@ void CInputManager::onMouseWheel(IPointer::SAxisEvent e) { if (*PFOLLOWMOUSE == 1 && PCURRWINDOW && PWINDOW != PCURRWINDOW) simulateMouseMovement(); } + factor = ISTOUCHPADSCROLL ? PWINDOW->getScrollTouchpad() : PWINDOW->getScrollMouse(); } } -- cgit v1.2.3