x11: Drop emulated pointer button events

Drop emulated pointer button events, as scroll valuators are handled natively, and SDL emulates mouse events from touch events on its own.
This commit is contained in:
Frank Praznik
2025-12-05 12:57:16 -05:00
parent e047aeeb7c
commit 3d2b79c096

View File

@@ -613,7 +613,7 @@ void X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie)
} else {
SDL_SendPenButton(0, pen->pen, window, button - 1, down);
}
} else {
} else if (!pointer_emulated) {
// Otherwise assume a regular mouse
SDL_WindowData *windowdata = xinput2_get_sdlwindowdata(videodata, xev->event);
int x_ticks = 0, y_ticks = 0;
@@ -627,12 +627,8 @@ void X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie)
/* Discard wheel events from "Master" devices to avoid duplicates,
* as coarse wheel events are stateless and can't be deduplicated.
*
* If the pointer emulation flag is set on a wheel event, it is being
* emulated from a scroll valuator, which will be handled natively.
*/
if ((pointer_emulated || xev->deviceid != xev->sourceid) &&
X11_IsWheelEvent(button, &x_ticks, &y_ticks)) {
if (xev->deviceid != xev->sourceid && X11_IsWheelEvent(button, &x_ticks, &y_ticks)) {
break;
}