Browse Source

Fixed mouse motion events while the mouse is grabbed

When the mouse is grabbed, the X server sends mouse events only to the grabbing client, and XInput2 events for the master device are not delivered.

We should consider using the window mouse rect confinement instead of a true X server grab for SDL mouse grab functionality.
Sam Lantinga 6 months ago
parent
commit
bc3264130d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/video/x11/SDL_x11events.c

+ 1 - 1
src/video/x11/SDL_x11events.c

@@ -1614,7 +1614,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
 
     case MotionNotify:
     {
-        if (data->xinput2_mouse_enabled) {
+        if (data->xinput2_mouse_enabled && !data->mouse_grabbed) {
             // This input is being handled by XInput2
             break;
         }