Browse Source

cocoa: Fix Cocoa_RaiseWindow not making child window key if SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED is true

- We intentionally don't raise the application when raising a child window to allow raising a child window to the top without setting the application active but the
  child window should still be set as key window for the application if desired.
Sam Lantinga 1 year ago
parent
commit
0a99ad7a68
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/video/cocoa/SDL_cocoawindow.m

+ 3 - 0
src/video/cocoa/SDL_cocoawindow.m

@@ -2360,6 +2360,9 @@ void Cocoa_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window)
             if (SDL_WINDOW_IS_POPUP(window)) {
                 NSWindow *nsparent = ((__bridge SDL_CocoaWindowData *)window->parent->driverdata).nswindow;
                 [nsparent addChildWindow:nswindow ordered:NSWindowAbove];
+                if (bActivate) {
+                    [nswindow makeKeyWindow];
+                }
             } else {
                 if (bActivate) {
                     [NSApp activateIgnoringOtherApps:YES];