Browse Source

cocoa: Toggle the fullscreen menu item to 'leave' when entering a fullscreen space

Only return 'NO' during the menu item validation if the window is fullscreen and not in a fullscreen space.
Frank Praznik 4 months ago
parent
commit
d4225070ad
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/video/cocoa/SDL_cocoawindow.m

+ 4 - 1
src/video/cocoa/SDL_cocoawindow.m

@@ -108,7 +108,10 @@
         SDL_Window *window = [self findSDLWindow];
         if (window == NULL) {
             return NO;
-        } else if (window->flags & SDL_WINDOW_FULLSCREEN) {
+        }
+
+        SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal;
+        if (window->flags & SDL_WINDOW_FULLSCREEN && ![data.listener isInFullscreenSpace]) {
             return NO;
         } else if ((window->flags & SDL_WINDOW_RESIZABLE) == 0) {
             return NO;