Browse Source

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.
Frank Praznik 2 weeks ago
parent
commit
3d2b79c096
1 changed files with 2 additions and 6 deletions
  1. 2 6
      src/video/x11/SDL_x11xinput2.c

+ 2 - 6
src/video/x11/SDL_x11xinput2.c

@@ -613,7 +613,7 @@ void X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie)
             } else {
             } else {
                 SDL_SendPenButton(0, pen->pen, window, button - 1, down);
                 SDL_SendPenButton(0, pen->pen, window, button - 1, down);
             }
             }
-        } else {
+        } else if (!pointer_emulated) {
             // Otherwise assume a regular mouse
             // Otherwise assume a regular mouse
             SDL_WindowData *windowdata = xinput2_get_sdlwindowdata(videodata, xev->event);
             SDL_WindowData *windowdata = xinput2_get_sdlwindowdata(videodata, xev->event);
             int x_ticks = 0, y_ticks = 0;
             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,
             /* Discard wheel events from "Master" devices to avoid duplicates,
              * as coarse wheel events are stateless and can't be deduplicated.
              * 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;
                 break;
             }
             }