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.
main
Sam Lantinga 2024-01-18 03:36:52 -08:00
parent 20e8411b12
commit 0a99ad7a68
1 changed files with 3 additions and 0 deletions

View File

@ -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];