[gtk+] reftests: Create the surface after running the main loop
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] reftests: Create the surface after running the main loop
- Date: Sun, 11 May 2014 01:24:11 +0000 (UTC)
commit f2258cb05cfaf96ba146d1244f4a4e2d8bafc1e8
Author: Benjamin Otte <otte redhat com>
Date: Sat May 10 17:20:11 2014 +0200
reftests: Create the surface after running the main loop
Running the main loop may cause resizes, so creating the surface based
on the size before running it seems wrong.
testsuite/reftests/gtk-reftest.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c
index 3cb8d0c..6ba5399 100644
--- a/testsuite/reftests/gtk-reftest.c
+++ b/testsuite/reftests/gtk-reftest.c
@@ -232,11 +232,6 @@ snapshot_widget (GtkWidget *widget, SnapshotMode mode)
g_assert (gtk_widget_get_realized (widget));
- surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
- CAIRO_CONTENT_COLOR,
- gtk_widget_get_allocated_width (widget),
- gtk_widget_get_allocated_height (widget));
-
loop = g_main_loop_new (NULL, FALSE);
/* We wait until the widget is drawn for the first time.
* We can not wait for a GtkWidget::draw event, because that might not
@@ -246,6 +241,11 @@ snapshot_widget (GtkWidget *widget, SnapshotMode mode)
gdk_event_handler_set (check_for_draw, loop, NULL);
g_main_loop_run (loop);
+ surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
+ CAIRO_CONTENT_COLOR,
+ gtk_widget_get_allocated_width (widget),
+ gtk_widget_get_allocated_height (widget));
+
cr = cairo_create (surface);
switch (mode)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]