# HG changeset patch # User Olaf Wintermann # Date 1779887093 -7200 # Node ID 218ada0d40179dab7154ad04ee20b24b94374300 # Parent e2a6707aa1e0f3b1b0e49e63e835b68a25a8cf6b add ui_open_uri (Cocoa) diff -r e2a6707aa1e0 -r 218ada0d4017 ui/cocoa/toolkit.m --- a/ui/cocoa/toolkit.m Tue May 26 21:05:47 2026 +0200 +++ b/ui/cocoa/toolkit.m Wed May 27 15:04:53 2026 +0200 @@ -130,6 +130,9 @@ void ui_main(void) { NSApplicationMain(app_argc, app_argv); + //[NSApp finishLaunching]; + //[NSApp activateIgnoringOtherApps:YES]; + //[NSApp run]; if(exit_on_shutdown) { exit(0); } @@ -147,6 +150,12 @@ [[NSApplication sharedApplication] terminate:nil]; } +void ui_open_uri(const char *uri) { + NSString *urlString = [NSString stringWithUTF8String:uri]; + NSURL *url = [NSURL URLWithString:urlString]; + [[NSWorkspace sharedWorkspace] openURL:url]; +} + /* ------------------- Window Visibility functions ------------------- */ void ui_show(UiObject *obj) { diff -r e2a6707aa1e0 -r 218ada0d4017 ui/common/wrapper.c --- a/ui/common/wrapper.c Tue May 26 21:05:47 2026 +0200 +++ b/ui/common/wrapper.c Wed May 27 15:04:53 2026 +0200 @@ -52,6 +52,7 @@ static int obj_unref(void *ptr) { ui_object_unref(ptr); + return 0; } void ui_mainthread_object_unref(UiObject *obj) { @@ -62,6 +63,7 @@ static int doc_unref(void *ptr) { ui_document_unref(ptr); + return 0; } void ui_mainthread_document_unref(void *doc) {