Subject: WindowShade Behavior Change

From: Andrew Veliath <[email-masked]>
Date: Thu, 16 Jan 1997 18:51:01 -0500 (EST)

WindowShade may confuse users in that if you accidently try to resize it
it may give you a zero size window (depending on size hints, etc.), and/or
some apps get messed up with variations of Maximize, which might lead a
user to inadvertently mess up a window or become confused.

At first this behavior was intended, but consequently, I now think it is
best to avoid these problems by inhibiting Maximize and Resize in the
shaded state (giving you a nice beep instead).

The change is trivial; here is the patch.

diff -ur orig/fvwm-2.0.44/fvwm/builtins.c fvwm-2.0.44/fvwm/builtins.c
--- orig/fvwm-2.0.44/fvwm/builtins.c	Tue Jan 14 11:38:36 1997
+++ fvwm-2.0.44/fvwm/builtins.c	Thu Jan 16 18:42:14 1997
@@ -319,7 +319,11 @@
   if(tmp_win == NULL)
     return;
   
-  if(check_allowed_function2(F_MAXIMIZE,tmp_win) == 0)
+  if(check_allowed_function2(F_MAXIMIZE,tmp_win) == 0
+#ifdef WINDOWSHADE
+     || (tmp_win->buttons & WSHADE)
+#endif
+      )
   {
     XBell(dpy, Scr.screen);
     return;
@@ -332,10 +336,6 @@
     val1_unit = Scr.MyDisplayWidth;
     val2_unit = Scr.MyDisplayHeight;
   }
-
-#ifdef WINDOWSHADE
-  tmp_win->buttons &= ~WSHADE;
-#endif
 
   if (tmp_win->flags & MAXIMIZED)
   {
diff -ur orig/fvwm-2.0.44/fvwm/resize.c fvwm-2.0.44/fvwm/resize.c
--- orig/fvwm-2.0.44/fvwm/resize.c	Mon Dec 23 17:07:47 1996
+++ fvwm-2.0.44/fvwm/resize.c	Thu Jan 16 18:41:22 1997
@@ -56,7 +56,11 @@
   if (DeferExecution(eventp,&w,&tmp_win,&context, MOVE, ButtonPress))
     return;
   
-  if(check_allowed_function2(F_RESIZE,tmp_win) == 0)
+  if(check_allowed_function2(F_RESIZE,tmp_win) == 0
+#ifdef WINDOWSHADE
+     || (tmp_win->buttons & WSHADE)
+#endif
+      )
     {
       XBell(dpy, Scr.screen);
       return;
@@ -64,9 +68,6 @@
   n = GetTwoArguments(action, &val1, &val2, &val1_unit, &val2_unit);
 
   tmp_win->flags &= ~MAXIMIZED;
-#ifdef WINDOWSHADE
-  tmp_win->buttons &= ~WSHADE;
-#endif
 
   /* Already checked this in functions.c, but its here too incase
    * there's a resize on initial placement. */

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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].