From 62db28607bae28c660bba1f559dbd5f44a6f89c7 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 7 Jul 2009 16:51:11 +0200 Subject: [PATCH] The shape is in window coordinate, so properly offset it when using it --- gdk/gdkwindow.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 6e72cab16f..d9b1e5b57e 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -639,7 +639,12 @@ remove_child_area (GdkWindowObject *private, child_region = gdk_region_rectangle (&r); if (child->shape) - gdk_region_intersect (child_region, child->shape); + { + /* Adjust shape region to parent window coords */ + gdk_region_offset (child->shape, child->x, child->y); + gdk_region_intersect (child_region, child->shape); + gdk_region_offset (child->shape, -child->x, -child->y); + } else if (private->window_type == GDK_WINDOW_FOREIGN) { shape = _gdk_windowing_window_get_shape ((GdkWindow *)child); @@ -4660,7 +4665,12 @@ _gdk_window_process_updates_recurse (GdkWindow *window, child_region = gdk_region_rectangle (&r); if (child->shape) - gdk_region_intersect (child_region, child->shape); + { + /* Adjust shape region to parent window coords */ + gdk_region_offset (child->shape, child->x, child->y); + gdk_region_intersect (child_region, child->shape); + gdk_region_offset (child->shape, -child->x, -child->y); + } if (child->impl == private->impl) {