Subject: FVWM CVS: fvwm clasen

From: CVS <[email-masked]>
Date: Wed, 3 Mar 1999 18:57:38 -0600 (CST)

CVSROOT:	/home/cvs/fvwm
Module name:	fvwm
Changes by:	clasen	99/03/03 18:57:37

Modified files:
	.              : ChangeLog 
	fvwm           : borders.c 

Log message:
Fix animated unshading for shaded+maximized windows.

--
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]

---

From: Tomas Ogren <[email-masked]>
Date: Thu, 4 Mar 1999 02:19:41 +0100

> Fix animated unshading for shaded+maximized windows.

Sorry to break your heart, but when the window is shaded, the geometry
is way off... mutt segfaults and "resize" reports 999 lines (prolly some
higher value, but it rounds down to some sane value).

I've been experimenting with calling SetupFrame before the actual
animation, but _not_ doing the XConfigureWindow around border.c:1520
before the animation. I have been unable to break that setup so far, but
it's a horrible kludge...

I'll get back to you..

/Tomas
-- 
Tomas Ögren, [email-masked], http://www.ing.umu.se/~stric/
|- Student of Computer Science at the University of Umeå
`- Sysadmin at {ing,acc}.umu.se
--
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]

---

From: Tomas Ogren <[email-masked]>
Date: Thu, 4 Mar 1999 02:44:38 +0100

> it's a horrible kludge...

Tada.

Could anyone try this (attached) horrible kludge? I haven't been able to
break it yet.. (The 'fix' checked in last by clasen made the bug go from
visual to actually doing harm)

/Tomas
-- 
Tomas Ögren, [email-masked], http://www.ing.umu.se/~stric/
|- Student of Computer Science at the University of Umeå
`- Sysadmin at {ing,acc}.umu.se
Index: builtins.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/builtins.c,v
retrieving revision 1.72
diff -u -r1.72 builtins.c
--- builtins.c	1999/03/04 01:14:15	1.72
+++ builtins.c	1999/03/04 01:40:04
@@ -24,6 +24,7 @@
 #include "screen.h"
 #include "module.h"
 
+extern int currshading;
 #ifdef WINDOWSHADE
 static int shade_anim_steps=0;
 #endif
@@ -458,6 +459,14 @@
 	else
 	    new_height = tmp_win->orig_ht;
 
+	currshading = 1;
+	SetupFrame(tmp_win,
+		   new_x,
+		   new_y,
+		   new_width,
+		   new_height,
+		   True);
+	currshading = 0;
 	if (shade_anim_steps > 0) {
 	    h = tmp_win->title_height+tmp_win->boundary_width;
 	    XMoveWindow(dpy, tmp_win->w, 0, - (new_height-h));
Index: borders.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/borders.c,v
retrieving revision 1.10
diff -u -r1.10 borders.c
--- borders.c	1999/03/04 00:57:37	1.10
+++ borders.c	1999/03/04 01:40:05
@@ -28,7 +28,7 @@
 #ifdef SHAPE
 #include <X11/extensions/shape.h>
 #endif
-
+int currshading = 0;
 void DrawButton(FvwmWindow *t,
                 Window win,
                 int W,
@@ -1497,20 +1497,28 @@
   cx = tmp_win->boundary_width;
   cy = tmp_win->title_height + tmp_win->boundary_width;
 
-  XResizeWindow(dpy, tmp_win->w, tmp_win->attr.width,
-                tmp_win->attr.height);
-  XMoveResizeWindow(dpy, tmp_win->Parent, cx,cy,
-                    tmp_win->attr.width, tmp_win->attr.height);
+#ifdef WINDOWSHADE
+  if (!shaded) {
+#endif
+      XResizeWindow(dpy, tmp_win->w, tmp_win->attr.width,
+		    tmp_win->attr.height);
+      XMoveResizeWindow(dpy, tmp_win->Parent, cx,cy,
+                        tmp_win->attr.width, tmp_win->attr.height);
+#ifdef WINDOWSHADE
+  }
+#endif
 
   /*
    * fix up frame and assign size/location values in tmp_win
    */
-  frame_wc.x = tmp_win->frame_x = x;
-  frame_wc.y = tmp_win->frame_y = y;
-  frame_wc.width = tmp_win->frame_width = w;
-  frame_wc.height = tmp_win->frame_height = h;
-  frame_mask = (CWX | CWY | CWWidth | CWHeight);
-  XConfigureWindow (dpy, tmp_win->frame, frame_mask, &frame_wc);
+  if (!currshading) {
+      frame_wc.x = tmp_win->frame_x = x;
+      frame_wc.y = tmp_win->frame_y = y;
+      frame_wc.width = tmp_win->frame_width = w;
+      frame_wc.height = tmp_win->frame_height = h;
+      frame_mask = (CWX | CWY | CWWidth | CWHeight);
+      XConfigureWindow (dpy, tmp_win->frame, frame_mask, &frame_wc);
+  }
 #ifdef FVWM_DEBUG_MSGS
   fvwm_msg(DBG,"SetupFrame",
            "New frame dimensions (x == %d, y == %d, w == %d, h == %d)",

---

From: Bob Woodside <[email-masked]>
Date: Thu, 04 Mar 1999 00:12:09 -0500

Tomas Ogren <[email-masked]> wrote:
> break it yet..

	Seems to work ok so far. I just blindly applied it to a fresh CVS
update and tried it out, so I can't comment on the aesthetics of your
solution. (Of course, windows behaving properly do have their own
aesthetic appeal!) I'll try to pound on it some more tomorrow.

	It's good to have windowshade animation back again!

- Bob