Mac: Don't give windows focus back when we're closing them.
authorJørgen P. Tjernø <jorgen@valvesoftware.com>
Wed, 15 Jan 2014 11:31:56 -0800
changeset 8111426e78ce52e4
parent 8110 98646f687e2b
child 8112 257daea8ac11
Mac: Don't give windows focus back when we're closing them.

Fixes bug #1840 (https://bugzilla.libsdl.org/show_bug.cgi?id=1840)
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Wed Jan 15 11:17:09 2014 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Wed Jan 15 11:31:56 2014 -0800
     1.3 @@ -299,9 +299,14 @@
     1.4         !!! FIXME:   http://bugzilla.libsdl.org/show_bug.cgi?id=1825
     1.5      */
     1.6      windows = [NSApp orderedWindows];
     1.7 -    if ([windows count] > 0) {
     1.8 -        NSWindow *win = (NSWindow *) [windows objectAtIndex:0];
     1.9 +    for (NSWindow *win in windows)
    1.10 +    {
    1.11 +        if (win == window) {
    1.12 +            continue;
    1.13 +        }
    1.14 +
    1.15          [win makeKeyAndOrderFront:self];
    1.16 +        break;
    1.17      }
    1.18  }
    1.19