diff options
Diffstat (limited to 'demos/widget-factory/widget-factory.c')
-rw-r--r-- | demos/widget-factory/widget-factory.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 559fb82c87..d50143deda 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -2000,6 +2000,13 @@ toggle_action (GSimpleAction *action, g_variant_new_boolean (!g_variant_get_boolean (state))); } +static gboolean +quit_timeout (gpointer data) +{ + exit (0); + return G_SOURCE_REMOVE; +} + int main (int argc, char *argv[]) { @@ -2065,6 +2072,9 @@ main (int argc, char *argv[]) g_application_add_main_option (G_APPLICATION (app), "version", 0, 0, G_OPTION_ARG_NONE, "Show program version", NULL); + if (g_getenv ("GTK_DEBUG_AUTO_QUIT")) + g_timeout_add (500, quit_timeout, NULL); + g_signal_connect (app, "handle-local-options", G_CALLBACK (local_options), NULL); status = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); |