Subject: ShapeNotify events for non-shaped windows

From: [email-masked]
Date: Sat, 7 Aug 1999 11:29:59 -0500 (CDT)

Full_Name: Owen Taylor
Version: 
CVS_Date: 7 Aug, 12pm
OS: Linux, glibc-2.1
X_Server: XFree 3.3.2.3
Submission from: (NULL) (165.247.161.17)

Description:

When a shape notify event is received for a window
that is _not_ shaped, the shape of the window is
propagated to the parent, causing window decorations
to be truncated.

How to replicate:

Switch GTK+ themes using the GNOME control center.
(among other ways). This may be fvwm2rc dependent
(otherwise it would have been noticed before, I
would guess).

Fix:

SetShape should unset the shape if the window is
not shaped, instead of setting it. A patch against
latest CVS follows:

Index: borders.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/borders.c,v
retrieving revision 1.55
diff -u -r1.55 borders.c
--- borders.c	1999/08/01 13:19:16	1.55
+++ borders.c	1999/08/07 16:29:55
@@ -1386,25 +1386,31 @@
 #ifdef SHAPE
   if (ShapesSupported)
   {
-    XRectangle rect;
-
-    XShapeCombineShape (dpy, tmp_win->frame, ShapeBounding,
-                        tmp_win->boundary_width,
-                        tmp_win->title_g.height+tmp_win->boundary_width,
-                        tmp_win->w,
-                        ShapeBounding, ShapeSet);
-    if (tmp_win->title_w)
+    if (tmp_win->wShaped)
     {
-      /* windows w/ titles */
-      rect.x = tmp_win->boundary_width;
-      rect.y = tmp_win->title_g.y;
-      rect.width = w - 2*tmp_win->boundary_width;
-      rect.height = tmp_win->title_g.height;
-
+      XRectangle rect;
 
-      XShapeCombineRectangles(dpy,tmp_win->frame,ShapeBounding,
-                              0,0,&rect,1,ShapeUnion,Unsorted);
+      XShapeCombineShape (dpy, tmp_win->frame, ShapeBounding,
+			  tmp_win->boundary_width,
+			  tmp_win->title_g.height+tmp_win->boundary_width,
+			  tmp_win->w,
+			  ShapeBounding, ShapeSet);
+      if (tmp_win->title_w)
+	{
+	  /* windows w/ titles */
+	  rect.x = tmp_win->boundary_width;
+	  rect.y = tmp_win->title_g.y;
+	  rect.width = w - 2*tmp_win->boundary_width;
+	  rect.height = tmp_win->title_g.height;
+	  
+	  
+	  XShapeCombineRectangles(dpy,tmp_win->frame,ShapeBounding,
+				  0,0,&rect,1,ShapeUnion,Unsorted);
+	}
     }
+    else
+      XShapeCombineMask (dpy, tmp_win->frame, ShapeBounding,
+			 0, 0, None, ShapeSet);
   }
 #endif
 }

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]