summaryrefslogtreecommitdiff
path: root/gdk/gdkwindow.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-04-11 12:15:30 +0200
committerAlexander Larsson <alexl@redhat.com>2013-04-11 12:15:30 +0200
commit645f6435e5a46345de3cf018ad328ff36c0e71e9 (patch)
tree7ce89034f901c178c8967dfcfffe32f056aff839 /gdk/gdkwindow.c
parent1884271f034ec8b3c7c4e6ffe02c04fd0e865bf9 (diff)
downloadgtk+-645f6435e5a46345de3cf018ad328ff36c0e71e9.tar.gz
gdkwindow: Handle updates created by outstanding moves in same update
If gdk_window_flush_outstanding_moves() creates new update area we handle this directly in the same draw to avoid flashing. This mainly affects win32 as X11 does its exposes from moves async. However, its important for win32 since ScrollDC seems to sometimes invalidate (and not copy) unexected regions. http://bugzilla.gnome.org/show_bug.cgi?674051
Diffstat (limited to 'gdk/gdkwindow.c')
-rw-r--r--gdk/gdkwindow.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 482f4990e6..3f0a58f4f7 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -4070,6 +4070,7 @@ gdk_window_process_updates_internal (GdkWindow *window)
GdkWindowImplClass *impl_class;
gboolean save_region = FALSE;
GdkRectangle clip_box;
+ int iteration;
/* Ensure the window lives while updating it */
g_object_ref (window);
@@ -4077,8 +4078,15 @@ gdk_window_process_updates_internal (GdkWindow *window)
/* If an update got queued during update processing, we can get a
* window in the update queue that has an empty update_area.
* just ignore it.
+ *
+ * We run this multiple times if needed because on win32 the
+ * first run can cause new (synchronous) updates from
+ * gdk_window_flush_outstanding_moves(). However, we
+ * limit it to two iterations to avoid any potential loops.
*/
- if (window->update_area)
+ iteration = 0;
+ while (window->update_area &&
+ iteration++ < 2)
{
cairo_region_t *update_area = window->update_area;
window->update_area = NULL;