Browse Source

Only save the pending flags we will restore when hiding a window

Fixes https://github.com/libsdl-org/SDL/issues/11564
Sam Lantinga 7 months ago
parent
commit
5a2eb60389
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/video/SDL_video.c

+ 2 - 1
src/video/SDL_video.c

@@ -3205,7 +3205,8 @@ bool SDL_HideWindow(SDL_Window *window)
     }
 
     // Store the flags for restoration later.
-    window->pending_flags = window->flags;
+    const SDL_WindowFlags pending_mask = (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED | SDL_WINDOW_FULLSCREEN | SDL_WINDOW_KEYBOARD_GRABBED | SDL_WINDOW_MOUSE_GRABBED);
+    window->pending_flags = (window->flags & pending_mask);
 
     window->is_hiding = true;
     if (_this->HideWindow) {