From d1043e590a08f6250edd92cacf7ec68b263c896d Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 20 Jan 2021 05:51:18 +1100 Subject: [PATCH] [client] x11: register for absolute motion events while grabbed --- client/displayservers/X11/x11.c | 5 ++--- client/src/main.c | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/displayservers/X11/x11.c b/client/displayservers/X11/x11.c index 43bcc22f..0a1dcee0 100644 --- a/client/displayservers/X11/x11.c +++ b/client/displayservers/X11/x11.c @@ -467,9 +467,6 @@ static bool x11EventFilter(SDL_Event * event) case XI_Motion: { - if (!x11.focused || !x11.entered) - return true; - XIDeviceEvent *device = cookie->data; app_updateCursorPos(device->event_x, device->event_y); return true; @@ -588,6 +585,7 @@ static void x11GrabPointer(void) XISetMask(mask.mask, XI_RawButtonPress ); XISetMask(mask.mask, XI_RawButtonRelease); XISetMask(mask.mask, XI_RawMotion ); + XISetMask(mask.mask, XI_Motion ); XIGrabDevice( x11.display, @@ -599,6 +597,7 @@ static void x11GrabPointer(void) GrabModeAsync, false, &mask); + XSync(x11.display, False); x11.pointerGrabbed = true; diff --git a/client/src/main.c b/client/src/main.c index dea3d947..39635fd4 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1356,7 +1356,6 @@ void app_handleMouseNormal(double ex, double ey) /* ungrab the pointer and move the local cursor to the exit point */ g_state.ds->ungrabPointer(); - warpPointer(tx, ty, true); return; }