]> Pileus Git - ~andy/gtk/commitdiff
The shape is in window coordinate, so properly offset it when using it
authorAlexander Larsson <alexl@redhat.com>
Tue, 7 Jul 2009 14:51:11 +0000 (16:51 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 7 Jul 2009 15:10:49 +0000 (17:10 +0200)
gdk/gdkwindow.c

index 6e72cab16f8f4d0de8b1d4bb4e8472020c2ae399..d9b1e5b57e04a1b265b54e9a460fde27a6ebac97 100644 (file)
@@ -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)
        {