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

From 0a99ad7a6868323a6b6ffe7cd6a937aaab07b441 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 18 Jan 2024 03:36:52 -0800
Subject: [PATCH] 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.
---
 src/video/cocoa/SDL_cocoawindow.m | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index 85b186626814..1308eb66ecda 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/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];