[gtk+/transparent-windows] gdk: gdk_window_get_update_area don't remove alpha covered areas
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/transparent-windows] gdk: gdk_window_get_update_area don't remove alpha covered areas
- Date: Mon, 5 Dec 2011 13:03:14 +0000 (UTC)
commit 4597f1ea6ad7bed980195c29af39e8e30f7dd54f
Author: Alexander Larsson <alexl redhat com>
Date: Mon Dec 5 12:18:22 2011 +0100
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.
gdk/gdkwindow.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 2fd5076..ae57b27 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]