ui/motif/toolkit.c

changeset 674
51670b0bc625
parent 659
d6baaa93f7be
child 795
d466b6edfebc
--- a/ui/motif/toolkit.c	Sun Jul 20 12:27:33 2025 +0200
+++ b/ui/motif/toolkit.c	Sun Jul 20 14:04:19 2025 +0200
@@ -52,17 +52,18 @@
 static ui_callback   startup_func;
 static void          *startup_data;
 static ui_callback   open_func;
-void                 *open_data;
+static void          *open_data;
 static ui_callback   exit_func;
-void                 *exit_data;
+static void          *exit_data;
 
 static ui_callback appclose_fnc;
 static void *appclose_udata;
 
 static int is_toplevel_realized = 0;
 
-int event_pipe[2];
+static int event_pipe[2];
 
+static UiBool        exit_on_shutdown;
 
 static String fallback[] = {
     	//"*fontList: -dt-interface system-medium-r-normal-s*utf*:",                 
@@ -139,6 +140,10 @@
     exit_data = userdata;
 }
 
+void ui_app_exit_on_shutdown(UiBool exitapp) {
+    exit_on_shutdown = exitapp;
+}
+
 void ui_main() {
     if(startup_func) {
         startup_func(NULL, startup_data);
@@ -148,6 +153,9 @@
         exit_func(NULL, exit_data);
     }
     uic_store_app_properties();
+    if(exit_on_shutdown) {
+        exit(0);
+    }
 }
 
 void ui_exit_mainloop() {

mercurial