summaryrefslogtreecommitdiff
path: root/src/xfns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xfns.c')
-rw-r--r--src/xfns.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 2845ecca6a9..6ed93ee42ca 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -6851,17 +6851,16 @@ The coordinates X and Y are interpreted in pixels relative to a position
#ifdef HAVE_XINPUT2
int deviceid;
- if (FRAME_DISPLAY_INFO (f)->supports_xi2)
+ deviceid = FRAME_DISPLAY_INFO (f)->client_pointer_device;
+
+ if (FRAME_DISPLAY_INFO (f)->supports_xi2
+ && deviceid != -1)
{
- XGrabServer (FRAME_X_DISPLAY (f));
- if (XIGetClientPointer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- &deviceid))
- {
- XIWarpPointer (FRAME_X_DISPLAY (f), deviceid, None,
- FRAME_DISPLAY_INFO (f)->root_window,
- 0, 0, 0, 0, xval, yval);
- }
- XUngrabServer (FRAME_X_DISPLAY (f));
+ x_catch_errors_for_lisp (FRAME_DISPLAY_INFO (f));
+ XIWarpPointer (FRAME_X_DISPLAY (f), deviceid, None,
+ FRAME_DISPLAY_INFO (f)->root_window,
+ 0, 0, 0, 0, xval, yval);
+ x_uncatch_errors_for_lisp (FRAME_DISPLAY_INFO (f));
}
else
#endif