summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-10-17 19:01:56 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-10-17 19:02:34 +0200
commitc62501c93a802a9853a9f44fc9e79b294a4be81c (patch)
tree23d375a8d1b482e7e74c654276259b1370b61e57
parent49900e37104a098f5a34ce923ba5be37498c580e (diff)
launching a binary from the command line hangs on macOS Sonoma (#799)
-rw-r--r--src/Fl_cocoa.mm7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 38c6299fa..ea5deb3ea 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1799,7 +1799,12 @@ void Fl_Cocoa_Screen_Driver::open_display_platform() {
FLAppDelegate *delegate = (Fl_Darwin_System_Driver::calc_mac_os_version() < 100500 ? [FLAppDelegateBefore10_5 alloc] : [FLAppDelegate alloc]);
[(NSApplication*)NSApp setDelegate:[delegate init]];
if (need_new_nsapp) {
- if (fl_mac_os_version >= 101300 && is_bundled() ) {
+ BOOL condition = (fl_mac_os_version >= 101300);
+ if (fl_mac_os_version >= 140000) { // hack to detect if app is started by Xcode
+ NSDictionary *environment = [[NSProcessInfo processInfo] environment];
+ condition = (environment[@"__XCODE_BUILT_PRODUCTS_DIR_PATHS"] != nil);
+ }
+ if (condition && is_bundled() ) {
[NSApp activateIgnoringOtherApps:YES];
in_nsapp_run = true;
[NSApp run];