summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-08-15 08:44:53 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-08-15 08:44:53 +0200
commite6440ca0a89874e2593b2dc9cf5a3b0e87df94a2 (patch)
treea9e42f95444403dce9ec234c5a723a160dbf1266
parent3c7610ec2336a2ab2b264d73feca89afbcfc61d2 (diff)
Wayland mouse wheel support: compositors can behave differently
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index ba8f4c386..3b7da39ea 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -343,7 +343,8 @@ static void pointer_axis(void *data,
Fl_Window *win = Fl_Wayland_Window_Driver::surface_to_window(seat->pointer_focus);
if (!win) return;
wld_event_time = time;
- int delta = wl_fixed_to_int(value) / 10;
+ int delta = wl_fixed_to_int(value);
+ if (abs(delta) >= 10) delta /= 10;
// fprintf(stderr, "FL_MOUSEWHEEL: %c delta=%d\n", axis==WL_POINTER_AXIS_HORIZONTAL_SCROLL?'H':'V', delta);
// allow both horizontal and vertical movements to be processed by the widget
if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) {