diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-02-09 22:24:47 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-02-09 23:12:32 -0500 |
commit | a6c54669007f3932d6e2813e618bb106579fd28f (patch) | |
tree | 13835ffeb8a11f13a6fc142023050a6bac0f9354 /tests/testappchooser.c | |
parent | c78971165215ca749af68c3f6f16fb7eca08e142 (diff) | |
download | gtk+-a6c54669007f3932d6e2813e618bb106579fd28f.tar.gz |
Stop using gtk_main and gtk_main_quit
Replace these calls with direct use of GMainContext api.
Diffstat (limited to 'tests/testappchooser.c')
-rw-r--r-- | tests/testappchooser.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/testappchooser.c b/tests/testappchooser.c index baf9adcad2..c1e7699986 100644 --- a/tests/testappchooser.c +++ b/tests/testappchooser.c @@ -151,11 +151,23 @@ button_clicked (GtkButton *b, g_free (path); } +static void +quit_cb (GtkWidget *widget, + gpointer data) +{ + gboolean *done = data; + + *done = TRUE; + + g_main_context_wakeup (NULL); +} + int main (int argc, char **argv) { GtkWidget *w1; gchar *path; + gboolean done = FALSE; gtk_init (); @@ -221,9 +233,10 @@ main (int argc, char **argv) gtk_container_add (GTK_CONTAINER (toplevel), grid); gtk_widget_show (toplevel); - g_signal_connect (toplevel, "destroy", G_CALLBACK (gtk_main_quit), NULL); + g_signal_connect (toplevel, "destroy", G_CALLBACK (quit_cb), &done); - gtk_main (); + while (!done) + g_main_context_iteration (NULL, TRUE); return EXIT_SUCCESS; } |