diff options
author | Alexander Larsson <alexl@redhat.com> | 2011-12-05 12:18:22 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2011-12-05 12:18:22 +0100 |
commit | 4597f1ea6ad7bed980195c29af39e8e30f7dd54f (patch) | |
tree | 2bcbb88313267d98c8116a38cbf684e4a9a73d3c /gdk | |
parent | 65ef15812bc889a2158732d0519c899fb9e436cf (diff) | |
download | gtk+-4597f1ea6ad7bed980195c29af39e8e30f7dd54f.tar.gz |
gdk: gdk_window_get_update_area don't remove alpha covered areas
gdk_window_get_update_area is supposed to get the area where things
need painting, and remove them from the update areas. However, if
some area is covered by other windows with an alpha background we
can't just expect whatever the app choses to render in the update
area as correct, so we don't actually remove these areas, meaning
they will get correctly rendered when we get to the expose handlers.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdkwindow.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 2fd50769bb..ae57b27ef6 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -4650,7 +4650,7 @@ cairo_region_t * gdk_window_get_update_area (GdkWindow *window) { GdkWindow *impl_window; - cairo_region_t *tmp_region; + cairo_region_t *tmp_region, *to_remove; g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); @@ -4670,7 +4670,21 @@ gdk_window_get_update_area (GdkWindow *window) } else { - cairo_region_subtract (impl_window->update_area, tmp_region); + /* Convert from impl coords */ + cairo_region_translate (tmp_region, -window->abs_x, -window->abs_y); + + /* Don't remove any update area that is overlapped by non-opaque windows + (children or siblings) with alpha, as these really need to be repainted + independently of this window. */ + to_remove = cairo_region_copy (tmp_region); + cairo_region_subtract (to_remove, window->parent->layered_region); + remove_layered_child_area (window, to_remove); + + /* Remove from update_area */ + cairo_region_translate (to_remove, window->abs_x, window->abs_y); + cairo_region_subtract (impl_window->update_area, to_remove); + + cairo_region_destroy (to_remove); if (cairo_region_is_empty (impl_window->update_area) && impl_window->outstanding_moves == NULL) @@ -4681,10 +4695,7 @@ gdk_window_get_update_area (GdkWindow *window) gdk_window_remove_update_window ((GdkWindow *)impl_window); } - /* Convert from impl coords */ - cairo_region_translate (tmp_region, -window->abs_x, -window->abs_y); return tmp_region; - } } else |