mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 19:55:19 +00:00
x11: Store the mouse button serial for emulated pointer events as well
Otherwise, filtered emulated button events, such as for mouse wheels, can slip through the core event handler.
This commit is contained in:
parent
e497077cbf
commit
f48525aa70
1 changed files with 3 additions and 3 deletions
|
|
@ -605,6 +605,9 @@ void X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie)
|
|||
bool pointer_emulated = false;
|
||||
#endif
|
||||
|
||||
// Store the button serial to filter out redundant core button events.
|
||||
videodata->xinput_last_button_serial = xev->serial;
|
||||
|
||||
if (pen) {
|
||||
if (xev->deviceid != xev->sourceid) {
|
||||
// Discard events from "Master" devices to avoid duplicates.
|
||||
|
|
@ -622,9 +625,6 @@ void X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie)
|
|||
SDL_WindowData *windowdata = X11_FindWindow(videodata, xev->event);
|
||||
int x_ticks = 0, y_ticks = 0;
|
||||
|
||||
// Store the button serial to filter out redundant core button events.
|
||||
videodata->xinput_last_button_serial = xev->serial;
|
||||
|
||||
if (xev->deviceid != videodata->xinput_master_pointer_device) {
|
||||
// Ignore slave button events on non-focused windows, or focus can be incorrectly set while a grab is active.
|
||||
if (SDL_GetMouseFocus() != windowdata->window) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue