* src/xfns.c (Fx_set_mouse_absolute_pixel_position):
* src/xterm.c (x_make_frame_invisible): Avoid race conditions
where the client pointer is destroyed between when it is
obtained and when XIWarpPointer is called.
if (FRAME_DISPLAY_INFO (f)->supports_xi2)
{
+ XGrabServer (FRAME_X_DISPLAY (f));
if (XIGetClientPointer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
&deviceid))
{
DefaultRootWindow (FRAME_X_DISPLAY (f)),
0, 0, 0, 0, xval, yval);
}
+ XUngrabServer (FRAME_X_DISPLAY (f));
}
else
#endif
if (FRAME_DISPLAY_INFO (f)->supports_xi2)
{
+ XGrabServer (FRAME_X_DISPLAY (f));
if (XIGetClientPointer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
&deviceid))
{
FRAME_X_WINDOW (f),
0, 0, 0, 0, pix_x, pix_y);
}
+ XUngrabServer (FRAME_X_DISPLAY (f));
}
else
#endif