x11: call XSync before XSetInputFocus during SDL_ShowWindow.

This only happens when using a non-NET_WM window manager, as we might try to
set the focus before the window is mapped.

Fixes #3949.
This commit is contained in:
Ryan C. Gordon 2021-04-24 19:47:10 -04:00
parent 89a2980a6d
commit 9c063468d6
No known key found for this signature in database
GPG Key ID: FA148B892AB48044

View File

@ -1158,6 +1158,7 @@ X11_ShowWindow(_THIS, SDL_Window * window)
if (!data->videodata->net_wm) { if (!data->videodata->net_wm) {
/* no WM means no FocusIn event, which confuses us. Force it. */ /* no WM means no FocusIn event, which confuses us. Force it. */
X11_XSync(display, False);
X11_XSetInputFocus(display, data->xwindow, RevertToNone, CurrentTime); X11_XSetInputFocus(display, data->xwindow, RevertToNone, CurrentTime);
X11_XFlush(display); X11_XFlush(display);
} }