summaryrefslogtreecommitdiff
path: root/tests/testwidgettransforms.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-02-09 22:24:47 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-02-09 23:12:32 -0500
commita6c54669007f3932d6e2813e618bb106579fd28f (patch)
tree13835ffeb8a11f13a6fc142023050a6bac0f9354 /tests/testwidgettransforms.c
parentc78971165215ca749af68c3f6f16fb7eca08e142 (diff)
downloadgtk+-a6c54669007f3932d6e2813e618bb106579fd28f.tar.gz
Stop using gtk_main and gtk_main_quit
Replace these calls with direct use of GMainContext api.
Diffstat (limited to 'tests/testwidgettransforms.c')
-rw-r--r--tests/testwidgettransforms.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/testwidgettransforms.c b/tests/testwidgettransforms.c
index d8cf78fc6c..f5a6f0aa78 100644
--- a/tests/testwidgettransforms.c
+++ b/tests/testwidgettransforms.c
@@ -278,6 +278,17 @@ toggled_cb (GtkToggleButton *source,
do_picking = gtk_toggle_button_get_active (source);
}
+static void
+quit_cb (GtkWidget *widget,
+ gpointer data)
+{
+ gboolean *done = data;
+
+ *done = TRUE;
+
+ g_main_context_wakeup (NULL);
+}
+
int
main (int argc, char **argv)
{
@@ -287,6 +298,7 @@ main (int argc, char **argv)
GtkWidget *titlebar;
GtkWidget *toggle_button;
GtkCssProvider *provider;
+ gboolean done = FALSE;
gtk_init ();
@@ -296,7 +308,6 @@ main (int argc, char **argv)
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
matrix_chooser = g_object_new (GTK_TYPE_MATRIX_CHOOSER, NULL);
transform_tester = g_object_new (GTK_TYPE_TRANSFORM_TESTER, NULL);
@@ -333,10 +344,11 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (window), box);
gtk_window_set_default_size ((GtkWindow *)window, 200, 200);
- g_signal_connect (window, "close-request", G_CALLBACK (gtk_main_quit), NULL);
+ g_signal_connect (window, "close-request", G_CALLBACK (quit_cb), &done);
gtk_widget_show (window);
- gtk_main ();
+ while (!done)
+ g_main_context_iteration (NULL, TRUE);
return 0;
}