summaryrefslogtreecommitdiff
path: root/tests/scrolling-performance.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/scrolling-performance.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/scrolling-performance.c')
-rw-r--r--tests/scrolling-performance.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/scrolling-performance.c b/tests/scrolling-performance.c
index bfba4acc74..4f195958ac 100644
--- a/tests/scrolling-performance.c
+++ b/tests/scrolling-performance.c
@@ -92,6 +92,17 @@ static GOptionEntry options[] = {
{ NULL }
};
+static void
+quit_cb (GtkWidget *widget,
+ gpointer data)
+{
+ gboolean *done = data;
+
+ *done = TRUE;
+
+ g_main_context_wakeup (NULL);
+}
+
int
main (int argc, char **argv)
{
@@ -101,6 +112,7 @@ main (int argc, char **argv)
GtkWidget *grid;
GError *error = NULL;
int i;
+ gboolean done = FALSE;
GOptionContext *context = g_option_context_new (NULL);
g_option_context_add_main_entries (context, options, NULL);
@@ -142,8 +154,10 @@ main (int argc, char **argv)
gtk_widget_show (window);
g_signal_connect (window, "destroy",
- G_CALLBACK (gtk_main_quit), NULL);
- gtk_main ();
+ G_CALLBACK (quit_cb), &done);
+
+ while (!done)
+ g_main_context_iteration (NULL, TRUE);
return 0;
}