From 6ad3e56e85afc17349207aa575d926823bed80dd Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Fri, 9 Aug 2024 23:04:46 +1000 Subject: [PATCH 1/2] fix: window not at front on OSX set object itself as the sender seems to fix it https://stackoverflow.com/a/5089809 --- RGFW.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RGFW.h b/RGFW.h index 699d5fc..49be3dc 100755 --- a/RGFW.h +++ b/RGFW.h @@ -7300,7 +7300,7 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ } // Show the window - ((id(*)(id, SEL, SEL))objc_msgSend)(win->src.window, sel_registerName("makeKeyAndOrderFront:"), NULL); + ((id(*)(id, SEL, SEL))objc_msgSend)(win->src.window, sel_registerName("makeKeyAndOrderFront:"), win->src.window); objc_msgSend_void_bool(win->src.window, sel_registerName("setIsVisible:"), true); if (!RGFW_loaded) { From dcbec40beb7b035f3485213588ede6bc8ee7ca40 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Fri, 9 Aug 2024 23:14:51 +1000 Subject: [PATCH 2/2] use activateIgnoringOtherApps: instead to bring to front https://github.com/glfw/glfw/blob/master/src/cocoa_window.m#L1238 --- RGFW.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RGFW.h b/RGFW.h index 49be3dc..fefcae0 100755 --- a/RGFW.h +++ b/RGFW.h @@ -7300,7 +7300,8 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */ } // Show the window - ((id(*)(id, SEL, SEL))objc_msgSend)(win->src.window, sel_registerName("makeKeyAndOrderFront:"), win->src.window); + objc_msgSend_void_bool(NSApp, sel_registerName("activateIgnoringOtherApps:"), true); + ((id(*)(id, SEL, SEL))objc_msgSend)(win->src.window, sel_registerName("makeKeyAndOrderFront:"), NULL); objc_msgSend_void_bool(win->src.window, sel_registerName("setIsVisible:"), true); if (!RGFW_loaded) {