Skip to content

Commit 3d2b79c

Browse files
committed
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.
1 parent e047aee commit 3d2b79c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/video/x11/SDL_x11xinput2.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ void X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie)
613613
} else {
614614
SDL_SendPenButton(0, pen->pen, window, button - 1, down);
615615
}
616-
} else {
616+
} else if (!pointer_emulated) {
617617
// Otherwise assume a regular mouse
618618
SDL_WindowData *windowdata = xinput2_get_sdlwindowdata(videodata, xev->event);
619619
int x_ticks = 0, y_ticks = 0;
@@ -627,12 +627,8 @@ void X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie)
627627

628628
/* Discard wheel events from "Master" devices to avoid duplicates,
629629
* as coarse wheel events are stateless and can't be deduplicated.
630-
*
631-
* If the pointer emulation flag is set on a wheel event, it is being
632-
* emulated from a scroll valuator, which will be handled natively.
633630
*/
634-
if ((pointer_emulated || xev->deviceid != xev->sourceid) &&
635-
X11_IsWheelEvent(button, &x_ticks, &y_ticks)) {
631+
if (xev->deviceid != xev->sourceid && X11_IsWheelEvent(button, &x_ticks, &y_ticks)) {
636632
break;
637633
}
638634

0 commit comments

Comments
 (0)