macOS: Fix menubar items being enabled when they shouldn't be.
authorAlex Szpakowski <slime73@gmail.com>
Thu, 31 Aug 2017 21:34:29 -0300
changeset 1143637b2fcd8fc8c
parent 11435 181eadbddae2
child 11437 d53f2dddf6ee
macOS: Fix menubar items being enabled when they shouldn't be.
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Thu Aug 31 21:26:13 2017 -0300
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Thu Aug 31 21:34:29 2017 -0300
     1.3 @@ -80,14 +80,14 @@
     1.4      if ([menuItem action] == @selector(toggleFullScreen:)) {
     1.5          SDL_Window *window = [self findSDLWindow];
     1.6          if (window == NULL) {
     1.7 -            return YES;
     1.8 +            return NO;
     1.9          } else if ((window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_FULLSCREEN_DESKTOP)) != 0) {
    1.10              return NO;
    1.11          } else if ((window->flags & SDL_WINDOW_RESIZABLE) == 0) {
    1.12              return NO;
    1.13          }
    1.14      }
    1.15 -    return YES;
    1.16 +    return [super validateMenuItem:menuItem];
    1.17  }
    1.18  
    1.19  - (BOOL)canBecomeKeyWindow