summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2024-07-07 20:00:43 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2024-07-07 20:00:43 +0200
commit2252ba98390505f353ea35e8ade3e3914b46c977 (patch)
treeb1d71cfd2becc63de8fbeff99f5f0ec98afb333d
parentecb3c9c6fca1af050b80f6ea94e03852bd51765b (diff)
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.
-rw-r--r--src/Fl_x.cxx5
1 files 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