Fix Cocoa_RaiseWindow activating the app when SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED is false

main
Sam Lantinga 2023-07-06 18:14:37 -07:00
parent c5bd2cba98
commit d57249034a
1 changed files with 1 additions and 1 deletions

View File

@ -2196,13 +2196,13 @@ void Cocoa_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window)
*/ */
[windowData.listener pauseVisibleObservation]; [windowData.listener pauseVisibleObservation];
if (![nswindow isMiniaturized] && [nswindow isVisible]) { if (![nswindow isMiniaturized] && [nswindow isVisible]) {
[NSApp activateIgnoringOtherApps:YES];
if (SDL_WINDOW_IS_POPUP(window)) { if (SDL_WINDOW_IS_POPUP(window)) {
NSWindow *nsparent = ((__bridge SDL_CocoaWindowData *)window->parent->driverdata).nswindow; NSWindow *nsparent = ((__bridge SDL_CocoaWindowData *)window->parent->driverdata).nswindow;
[nsparent addChildWindow:nswindow ordered:NSWindowAbove]; [nsparent addChildWindow:nswindow ordered:NSWindowAbove];
} }
if (bActivate) { if (bActivate) {
[NSApp activateIgnoringOtherApps:YES];
[nswindow makeKeyAndOrderFront:nil]; [nswindow makeKeyAndOrderFront:nil];
} else { } else {
[nswindow orderFront:nil]; [nswindow orderFront:nil];