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.
This commit is contained in:
Albrecht Schlosser 2024-07-07 20:00:43 +02:00
parent ecb3c9c6fc
commit 2252ba9839

View File

@ -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