summaryrefslogtreecommitdiff
path: root/gdk/gdkwindow.c
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2005-03-28 20:28:43 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2005-03-28 20:28:43 +0000
commit8e5713f3e089f7d565d78502312998cb6668a21c (patch)
treeea18919d46e1a5f37f6d9841b0aa319960af2dfc /gdk/gdkwindow.c
parent0e832d57fc5cf4bc8a9d99f5341bc77ec44a5c2d (diff)
downloadgdk-pixbuf-8e5713f3e089f7d565d78502312998cb6668a21c.tar.gz
Don't invalidate areas that are covered by mapped input-output child
Mon Mar 28 15:13:42 2005 Søren Sandmann <sandmann@redhat.com> * gdk/gdkwindow.c (gdk_window_invalidate_maybe_recurse): Don't invalidate areas that are covered by mapped input-output child windows. Bug 141380.
Diffstat (limited to 'gdk/gdkwindow.c')
-rw-r--r--gdk/gdkwindow.c68
1 files changed, 40 insertions, 28 deletions
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 808926f20..54a0f0001 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2441,6 +2441,7 @@ gdk_window_invalidate_maybe_recurse (GdkWindow *window,
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkRegion *visible_region;
+ GList *tmp_list;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -2454,6 +2455,45 @@ gdk_window_invalidate_maybe_recurse (GdkWindow *window,
visible_region = gdk_drawable_get_visible_region (window);
gdk_region_intersect (visible_region, region);
+ tmp_list = private->children;
+ while (tmp_list)
+ {
+ GdkWindowObject *child = tmp_list->data;
+
+ if (!child->input_only)
+ {
+ GdkRegion *child_region;
+ GdkRectangle child_rect;
+
+ gdk_window_get_position ((GdkWindow *)child,
+ &child_rect.x, &child_rect.y);
+ gdk_drawable_get_size ((GdkDrawable *)child,
+ &child_rect.width, &child_rect.height);
+
+ child_region = gdk_region_rectangle (&child_rect);
+
+ /* remove child area from the invalid area of the parent */
+ if (GDK_WINDOW_IS_MAPPED (child))
+ gdk_region_subtract (visible_region, child_region);
+
+ if (child_func && (*child_func) ((GdkWindow *)child, user_data))
+ {
+ gdk_region_offset (region, - child_rect.x, - child_rect.y);
+ gdk_region_offset (child_region, - child_rect.x, - child_rect.y);
+ gdk_region_intersect (child_region, region);
+
+ gdk_window_invalidate_maybe_recurse ((GdkWindow *)child,
+ child_region, child_func, user_data);
+
+ gdk_region_offset (region, child_rect.x, child_rect.y);
+ }
+
+ gdk_region_destroy (child_region);
+ }
+
+ tmp_list = tmp_list->next;
+ }
+
if (!gdk_region_empty (visible_region))
{
if (debug_updates)
@@ -2470,34 +2510,6 @@ gdk_window_invalidate_maybe_recurse (GdkWindow *window,
gdk_window_schedule_update (window);
}
-
- if (child_func)
- {
- GList *tmp_list;
-
- tmp_list = private->children;
- while (tmp_list)
- {
- GdkWindowObject *child = tmp_list->data;
- tmp_list = tmp_list->next;
-
- if (!child->input_only && (*child_func) ((GdkWindow *)child, user_data))
- {
- GdkRegion *child_region;
- gint x, y;
-
- gdk_window_get_position ((GdkWindow *)child, &x, &y);
-
- /* This copy could be saved with a little more complexity */
- child_region = gdk_region_copy (visible_region);
- gdk_region_offset (child_region, - x, - y);
-
- gdk_window_invalidate_maybe_recurse ((GdkWindow *)child, child_region, child_func, user_data);
-
- gdk_region_destroy (child_region);
- }
- }
- }
}
gdk_region_destroy (visible_region);