]> Pileus Git - ~andy/gtk/commitdiff
Automatically flush window when doing non-double-buffered expose
authorAlexander Larsson <alexl@redhat.com>
Mon, 14 Sep 2009 14:07:43 +0000 (16:07 +0200)
committerAlexander Larsson <alexl@redhat.com>
Mon, 14 Sep 2009 14:07:43 +0000 (16:07 +0200)
Applications using non-double-buffered drawing using cairo (e.g. Abiword)
can draw directly to the window using cairo and thus manage to avoid
the automatic flushing of outstanding moves. This can cause redraw
inconsistencies like bug 593507.

We fix this by always flushing when exposing non-double-buffered widgets.

docs/reference/gdk/gdk-sections.txt
gtk/gtkmain.c

index 5bdc7170681ba0d68e1a6809d24a91f3c6fbee60..43d000c709918c20c6a68c1e08a2269a045ef62d 100644 (file)
@@ -662,6 +662,7 @@ gdk_window_resize
 gdk_window_move_resize
 gdk_window_scroll
 gdk_window_move_region
+gdk_window_flush
 gdk_window_ensure_native
 gdk_window_reparent
 gdk_window_clear
index 11aee08fbca030f3a7b3c738deedcbfbbc9bb7a1..e47e1beab367e715114caf5f9e587a89ff02310c 100644 (file)
@@ -1559,7 +1559,15 @@ gtk_main_do_event (GdkEvent *event)
          gdk_window_end_paint (event->any.window);
        }
       else
-       gtk_widget_send_expose (event_widget, event);
+       {
+         /* The app may paint with a previously allocated cairo_t,
+            which will draw directly to the window. We can't catch cairo
+            drap operatoins to automatically flush the window, thus we
+            need to explicitly flush any outstanding moves or double
+            buffering */
+         gdk_window_flush (event->any.window);
+         gtk_widget_send_expose (event_widget, event);
+       }
       break;
 
     case GDK_PROPERTY_NOTIFY: