src/video/cocoa/SDL_cocoawindow.m
changeset 7534 f0f5143b27cf
parent 7507 885b4aab4190
child 7535 c515121a3df7
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sat Jul 27 14:22:52 2013 +0200
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Mon Jul 22 20:55:07 2013 -0400
     1.3 @@ -131,6 +131,7 @@
     1.4      NSNotificationCenter *center;
     1.5      NSWindow *window = _data->nswindow;
     1.6      NSView *view = [window contentView];
     1.7 +    NSArray *windows = nil;
     1.8  
     1.9      center = [NSNotificationCenter defaultCenter];
    1.10  
    1.11 @@ -155,6 +156,14 @@
    1.12      if ([view nextResponder] == self) {
    1.13          [view setNextResponder:nil];
    1.14      }
    1.15 +
    1.16 +    /* Make the next window in the z-order Key. If we weren't the foreground
    1.17 +       when closed, this is a no-op. */
    1.18 +    windows = [NSApp orderedWindows];
    1.19 +    if ([windows count] > 0) {
    1.20 +        NSWindow *win = (NSWindow *) [windows objectAtIndex:0];
    1.21 +        [win makeKeyAndOrderFront:self];
    1.22 +    }
    1.23  }
    1.24  
    1.25  - (BOOL)windowShouldClose:(id)sender