Don't use XIWarpPointer() on multi-display configurations

This commit is contained in:
Sam Lantinga 2022-10-25 12:14:00 -07:00
parent 393acf6362
commit e3f5744db4
1 changed files with 6 additions and 1 deletions

View File

@ -317,7 +317,12 @@ WarpMouseInternal(Window xwindow, const int x, const int y)
Display *display = videodata->display; Display *display = videodata->display;
#if SDL_VIDEO_DRIVER_X11_XINPUT2 #if SDL_VIDEO_DRIVER_X11_XINPUT2
int deviceid = 0; int deviceid = 0;
/* It seems XIWarpPointer() doesn't work correctly on multi-head setups:
* https://developer.blender.org/rB165caafb99c6846e53d11c4e966990aaffc06cea
*/
if (SDL_GetNumVideoDisplays() == 1) {
X11_XIGetClientPointer(display, None, &deviceid); X11_XIGetClientPointer(display, None, &deviceid);
}
if (deviceid != 0) { if (deviceid != 0) {
X11_XIWarpPointer(display, deviceid, None, xwindow, 0.0, 0.0, 0, 0, (double)x, (double)y); X11_XIWarpPointer(display, deviceid, None, xwindow, 0.0, 0.0, 0, 0, (double)x, (double)y);
} else } else