]> Pileus Git - ~andy/gtk/commitdiff
gdk: Fix alpha window background paintings on non-implicit paints
authorAlexander Larsson <alexl@redhat.com>
Mon, 5 Dec 2011 10:40:30 +0000 (11:40 +0100)
committerAlexander Larsson <alexl@redhat.com>
Mon, 5 Dec 2011 10:40:30 +0000 (11:40 +0100)
gdk/gdkwindow.c

index a3a62669a4b7a93b73659eb27fd5018ce4766625..912b9b4e3164c75dabdd7ccf2478476d0a286c23 100644 (file)
@@ -2907,6 +2907,20 @@ gdk_window_begin_paint_region (GdkWindow       *window,
                                                           gdk_window_get_content (window),
                                                          MAX (clip_box.width, 1),
                                                           MAX (clip_box.height, 1));
+
+      /* Normally alpha backgrounded client side windows are composited on the implicit paint
+        by being drawn in back to front order. However, if implicit paints are not used, for
+        instance if it was flushed due to a non-double-buffered paint in the middle of the
+        expose we need to copy in the existing data here. */
+      if (!gdk_window_has_impl (window) && window->has_alpha_background)
+       {
+         cairo_t *cr = cairo_create (paint->surface);
+         gdk_cairo_set_source_window (cr, impl_window,
+                                      - (window->abs_x + clip_box.x),
+                                      - (window->abs_y + clip_box.y));
+         cairo_paint (cr);
+         cairo_destroy (cr);
+       }
     }
   cairo_surface_set_device_offset (paint->surface, -clip_box.x, -clip_box.y);