From 2252ba98390505f353ea35e8ade3e3914b46c977 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sun, 7 Jul 2024 20:00:43 +0200 Subject: [PATCH] X11: don't send FL_RELEASE event after FL_MOUSEWHEEL Horizontal mousewheel events use pseudo button numbers 6 and 7, resp., similar to vertical mousewheel events which use buttons 4 and 5. The old code erroneously sent FL_RELEASE events for buttons 6 and 7 although it was prevented for buttons 4 and 5 explicitly. --- src/Fl_x.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 9f06c5421..00ddaed2e 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2067,8 +2067,9 @@ int fl_handle(const XEvent& thisevent) Fl::e_keysym = FL_Button + xevent.xbutton.button; set_event_xy(window); Fl::e_state &= ~(FL_BUTTON1 << (xevent.xbutton.button-1)); - if (xevent.xbutton.button == Button4 || - xevent.xbutton.button == Button5) return 0; + if (xevent.xbutton.button > Button3) { // "buttons" 4-7 = mousewheel events: don't send FL_RELEASE + return 0; + } event = FL_RELEASE; #if FLTK_CONSOLIDATE_MOTION