From b15d9fcebbafc583906a5896dc73dacd0814544c Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 12 Apr 2022 12:01:34 +0800 Subject: [PATCH] * src/xterm.c (frame_set_mouse_pixel_position): Avoid server grab. --- src/xterm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 342f2b044f9..b1d9ca7361b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -20850,16 +20850,17 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) if (FRAME_DISPLAY_INFO (f)->supports_xi2) { - XGrabServer (FRAME_X_DISPLAY (f)); - if (XIGetClientPointer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + if (XIGetClientPointer (FRAME_X_DISPLAY (f), + FRAME_X_WINDOW (f), &deviceid)) { + x_catch_errors (FRAME_X_DISPLAY (f)); XIWarpPointer (FRAME_X_DISPLAY (f), deviceid, None, FRAME_X_WINDOW (f), 0, 0, 0, 0, pix_x, pix_y); + x_uncatch_errors (); } - XUngrabServer (FRAME_X_DISPLAY (f)); } else #endif -- 2.39.5