|
@@ -1576,6 +1576,13 @@ X11_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
|
|
oldstyle_fullscreen = X11_IsWindowLegacyFullscreen(_this, window);
|
|
oldstyle_fullscreen = X11_IsWindowLegacyFullscreen(_this, window);
|
|
|
|
|
|
if (oldstyle_fullscreen || grabbed) {
|
|
if (oldstyle_fullscreen || grabbed) {
|
|
|
|
+ /* If the window is unmapped, XGrab calls return GrabNotViewable,
|
|
|
|
+ so when we get a MapNotify later, we'll try to update the grab as
|
|
|
|
+ appropriate. */
|
|
|
|
+ if (window->flags & SDL_WINDOW_HIDDEN) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Try to grab the mouse */
|
|
/* Try to grab the mouse */
|
|
if (!data->videodata->broken_pointer_grab) {
|
|
if (!data->videodata->broken_pointer_grab) {
|
|
const unsigned int mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask;
|
|
const unsigned int mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask;
|