Skip to content

Commit bc32641

Browse files
committed
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.
1 parent 69d361d commit bc32641

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/video/x11/SDL_x11events.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
16141614

16151615
case MotionNotify:
16161616
{
1617-
if (data->xinput2_mouse_enabled) {
1617+
if (data->xinput2_mouse_enabled && !data->mouse_grabbed) {
16181618
// This input is being handled by XInput2
16191619
break;
16201620
}

0 commit comments

Comments
 (0)