summaryrefslogtreecommitdiff
path: root/testsuite/reftests
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-05-28 15:10:38 +0200
committerAlexander Larsson <alexl@redhat.com>2020-05-28 15:13:13 +0200
commit20f15f51119cb5a7fe188721eb473ab90b19d7f0 (patch)
tree551bc7bd78d421aa1d6aece7736f1bb7400de4ae /testsuite/reftests
parent9ef3e700400d5d4d4fcfeb37cfe757566658b456 (diff)
downloadgtk+-20f15f51119cb5a7fe188721eb473ab90b19d7f0.tar.gz
reftests: Fix frame inhibiting
Actually inhibit snapshotting of frames from reftest_inhibit_snapshot. We were not ignoring the case where inhibit_count > 0, and then disconnected the callback meaning we only ever got the first snapshot.
Diffstat (limited to 'testsuite/reftests')
-rw-r--r--testsuite/reftests/reftest-snapshot.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/testsuite/reftests/reftest-snapshot.c b/testsuite/reftests/reftest-snapshot.c
index 0e2800ec06..5ea2262fe5 100644
--- a/testsuite/reftests/reftest-snapshot.c
+++ b/testsuite/reftests/reftest-snapshot.c
@@ -206,14 +206,19 @@ reftest_inhibit_snapshot (void)
inhibit_count++;
}
-G_MODULE_EXPORT void
+G_MODULE_EXPORT gboolean
reftest_uninhibit_snapshot (void)
{
g_assert (inhibit_count > 0);
inhibit_count--;
if (inhibit_count == 0)
- g_idle_add (quit_when_idle, loop);
+ {
+ g_idle_add (quit_when_idle, loop);
+ return TRUE;
+ }
+
+ return FALSE;
}
static void
@@ -225,6 +230,8 @@ draw_paintable (GdkPaintable *paintable,
cairo_surface_t *surface;
cairo_t *cr;
+ if (!reftest_uninhibit_snapshot ())
+ return;
snapshot = gtk_snapshot_new ();
gdk_paintable_snapshot (paintable,
@@ -248,7 +255,6 @@ draw_paintable (GdkPaintable *paintable,
cairo_destroy (cr);
gsk_render_node_unref (node);
- reftest_uninhibit_snapshot ();
g_signal_handlers_disconnect_by_func (paintable, draw_paintable, out_surface);
*(cairo_surface_t **) out_surface = surface;