Forráskód Böngészése

cocoa: Make SDL_MinimizeWindow() work with borderless windows.

Fixes #6046.
Ryan C. Gordon 2 éve
szülő
commit
26948f01a3
1 módosított fájl, 5 hozzáadás és 3 törlés
  1. 5 3
      src/video/cocoa/SDL_cocoawindow.m

+ 5 - 3
src/video/cocoa/SDL_cocoawindow.m

@@ -299,12 +299,14 @@ GetHintCtrlClickEmulateRightClick()
 static NSUInteger
 GetWindowWindowedStyle(SDL_Window * window)
 {
-    NSUInteger style = 0;
+    /* always allow miniaturization, otherwise you can't programatically
+       minimize the window, whether there's a title bar or not */
+    NSUInteger style = NSWindowStyleMaskMiniaturizable;
 
     if (window->flags & SDL_WINDOW_BORDERLESS) {
-        style = NSWindowStyleMaskBorderless;
+        style |= NSWindowStyleMaskBorderless;
     } else {
-        style = (NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable);
+        style |= (NSWindowStyleMaskTitled|NSWindowStyleMaskClosable);
     }
     if (window->flags & SDL_WINDOW_RESIZABLE) {
         style |= NSWindowStyleMaskResizable;