ui/motif/toolkit.c

changeset 108
77254bd6dccb
parent 103
6606616eca9f
child 110
c00e968d018b
--- a/ui/motif/toolkit.c	Sat Apr 05 17:57:04 2025 +0200
+++ b/ui/motif/toolkit.c	Sun Jul 20 22:04:39 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() {
@@ -202,6 +210,7 @@
         event.document = job->obj->ctx->document;
         event.intval = 0;
         event.eventdata = NULL;
+        event.eventdatatype = 0;
         job->finish_callback(&event, job->finish_data);
     }
     free(job);

mercurial