Commit d7ae313134f2abec908d6f205c196323e6b3b03a

Alex Szpakowski 2017-08-31T21:34:29

macOS: Fix menubar items being enabled when they shouldn't be.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index 5572c6a..659bf92 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -80,14 +80,14 @@
     if ([menuItem action] == @selector(toggleFullScreen:)) {
         SDL_Window *window = [self findSDLWindow];
         if (window == NULL) {
-            return YES;
+            return NO;
         } else if ((window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_FULLSCREEN_DESKTOP)) != 0) {
             return NO;
         } else if ((window->flags & SDL_WINDOW_RESIZABLE) == 0) {
             return NO;
         }
     }
-    return YES;
+    return [super validateMenuItem:menuItem];
 }
 
 - (BOOL)canBecomeKeyWindow