summaryrefslogtreecommitdiff
path: root/gtk/gtktestutils.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 /gtk/gtktestutils.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 'gtk/gtktestutils.c')
-rw-r--r--gtk/gtktestutils.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c
index 34c802bced..4b4018fa81 100644
--- a/gtk/gtktestutils.c
+++ b/gtk/gtktestutils.c
@@ -87,7 +87,11 @@ quit_main_loop_callback (GtkWidget *widget,
GdkFrameClock *frame_clock,
gpointer user_data)
{
- gtk_main_quit ();
+ gboolean *done = user_data;
+
+ *done = TRUE;
+
+ g_main_context_wakeup (NULL);
return G_SOURCE_REMOVE;
}
@@ -108,6 +112,7 @@ void
gtk_test_widget_wait_for_draw (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
+ gboolean done = FALSE;
/* We can do this here because the whole tick procedure does not
* reenter the main loop. Otherwise we'd need to manually get the
@@ -115,10 +120,11 @@ gtk_test_widget_wait_for_draw (GtkWidget *widget)
*/
gtk_widget_add_tick_callback (widget,
quit_main_loop_callback,
- NULL,
+ &done,
NULL);
- gtk_main ();
+ while (!done)
+ g_main_context_iteration (NULL, TRUE);
}
static GType *all_registered_types = NULL;