mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 11:25:22 +08:00
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:
+3
-2
@@ -2067,8 +2067,9 @@ int fl_handle(const XEvent& thisevent)
|
|||||||
Fl::e_keysym = FL_Button + xevent.xbutton.button;
|
Fl::e_keysym = FL_Button + xevent.xbutton.button;
|
||||||
set_event_xy(window);
|
set_event_xy(window);
|
||||||
Fl::e_state &= ~(FL_BUTTON1 << (xevent.xbutton.button-1));
|
Fl::e_state &= ~(FL_BUTTON1 << (xevent.xbutton.button-1));
|
||||||
if (xevent.xbutton.button == Button4 ||
|
if (xevent.xbutton.button > Button3) { // "buttons" 4-7 = mousewheel events: don't send FL_RELEASE
|
||||||
xevent.xbutton.button == Button5) return 0;
|
return 0;
|
||||||
|
}
|
||||||
event = FL_RELEASE;
|
event = FL_RELEASE;
|
||||||
|
|
||||||
#if FLTK_CONSOLIDATE_MOTION
|
#if FLTK_CONSOLIDATE_MOTION
|
||||||
|
|||||||
Reference in New Issue
Block a user