ui/cocoa/AppDelegate.m

changeset 1189
6efc3994e8dd
parent 1188
92841501de20
child 1190
7dcd5994c9a5
--- a/ui/cocoa/AppDelegate.m	Wed Jun 10 18:04:30 2026 +0200
+++ b/ui/cocoa/AppDelegate.m	Thu Jun 11 20:27:11 2026 +0200
@@ -38,9 +38,15 @@
 
 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
     NSLog(@"toolkit applicationDidFinishLaunching");
-    uic_application_init(NULL);
     ui_menu_init();
     uic_application_startup(NULL);
+    // run ui_menu_init again, because it is possible, that the startup func
+    // added menus (which is probably true when using other language bindings)
+    // the menu init func can be called multiple times and is also called
+    // when a new window is created
+    // The only usecase for calling init here is, that an application might not
+    // open a window on startup, but wants a working menubar
+    ui_menu_init();
 }
 
 - (void)applicationWillTerminate:(NSNotification *)aNotification {

mercurial