From 44012804058c15489a38f39c0716dd482738c053 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 26 Sep 2005 20:27:44 +0000 Subject: [PATCH] Fix #316871, reported by Dan Winship: 2005-09-26 Matthias Clasen Fix #316871, reported by Dan Winship: * gdk/gdkwindow.h (struct _GdkWindowObject): Add a shaped flag. * gdk/x11/gdkwindow-x11.c (gdk_window_shape_combine_mask) (gdk_window_shape_combine_region): Set it here. * gdk/gdkwindow.c (gdk_window_invalidate_maybe_recurse): Don't remove the child area for shaped windows. --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ gdk/gdkwindow.c | 2 +- gdk/gdkwindow.h | 1 + gdk/x11/gdkwindow-x11.c | 10 +++++++++- 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb6ea23317..b9061a6183 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-09-26 Matthias Clasen + + Fix #316871, reported by Dan Winship: + + * gdk/gdkwindow.h (struct _GdkWindowObject): Add a shaped flag. + + * gdk/x11/gdkwindow-x11.c (gdk_window_shape_combine_mask) + (gdk_window_shape_combine_region): Set it here. + + * gdk/gdkwindow.c (gdk_window_invalidate_maybe_recurse): Don't + remove the child area for shaped windows. + 2005-09-23 Matthias Clasen * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_finalize): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index cb6ea23317..b9061a6183 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +2005-09-26 Matthias Clasen + + Fix #316871, reported by Dan Winship: + + * gdk/gdkwindow.h (struct _GdkWindowObject): Add a shaped flag. + + * gdk/x11/gdkwindow-x11.c (gdk_window_shape_combine_mask) + (gdk_window_shape_combine_region): Set it here. + + * gdk/gdkwindow.c (gdk_window_invalidate_maybe_recurse): Don't + remove the child area for shaped windows. + 2005-09-23 Matthias Clasen * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_finalize): diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 186d85d928..de19d3f74f 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -2450,7 +2450,7 @@ gdk_window_invalidate_maybe_recurse (GdkWindow *window, child_region = gdk_region_rectangle (&child_rect); /* remove child area from the invalid area of the parent */ - if (GDK_WINDOW_IS_MAPPED (child)) + if (GDK_WINDOW_IS_MAPPED (child) && !child->shaped) gdk_region_subtract (visible_region, child_region); if (child_func && (*child_func) ((GdkWindow *)child, user_data)) diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index c1b14468f7..60d2f0b5c7 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -287,6 +287,7 @@ struct _GdkWindowObject guint accept_focus : 1; guint focus_on_map : 1; + guint shaped : 1; GdkEventMask event_mask; }; diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index eeeb3e9a92..30722fe133 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -3672,6 +3672,7 @@ gdk_window_shape_combine_mask (GdkWindow *window, GdkBitmap *mask, gint x, gint y) { + GdkWindowObject *private = (GdkWindowObject *)window; Pixmap pixmap; gint xoffset, yoffset; @@ -3694,12 +3695,16 @@ gdk_window_shape_combine_mask (GdkWindow *window, if (mask) { pixmap = GDK_PIXMAP_XID (mask); + + private->shaped = TRUE; } else { x = 0; y = 0; pixmap = None; + + private->shaped = FALSE; } XShapeCombineMask (GDK_WINDOW_XDISPLAY (window), @@ -3741,7 +3746,8 @@ gdk_window_shape_combine_region (GdkWindow *window, GdkRegion *shape_region, gint offset_x, gint offset_y) -{ +{ + GdkWindowObject *private = (GdkWindowObject *)window; gint xoffset, yoffset; g_return_if_fail (GDK_IS_WINDOW (window)); @@ -3770,6 +3776,8 @@ gdk_window_shape_combine_region (GdkWindow *window, gint n_rects = 0; XRectangle *xrects = NULL; + private->shaped = TRUE; + _gdk_region_get_xrectangles (shape_region, 0, 0, &xrects, &n_rects);