Subject: Patch for Maximize function

From: Rafał Bisingier <[email-masked]>
Date: Sat, 13 Mar 2004 20:33:53 +0100

Hi,

I'm a quite new fvwm user, but already love it's fexibility.

I needed a little upgrade in Maximize growing functions, so I've made a
patch ;-)
It adds another option to the Maximize command called overlayer which
take one parameter - number of layer over which windows can grow.
So any window maximized using "Maximize overlayer 2 grow grow" grows
over any windows on layers 0,1 and 2
I hope this description is clear enough. If not the patch contains also
man page update, so try there ;-)

Greetings
Rafal Bisingier

PS. Sorry for my english. I've tried to make it understandable ;-)

diff -u fvwm.orig/fvwm.1.in fvwm/fvwm.1.in
--- fvwm.orig/fvwm.1.in	2004-02-19 10:36:01.000000000 +0100
+++ fvwm/fvwm.1.in	2004-03-10 15:15:19.790277504 +0100
@@ -5369,12 +5369,16 @@
 .I flags
 argument is a space separated list containing the following
 key words:
-.IR ewmhiwa ", " layer " and " screen .
+.IR ewmhiwa ", " layer ", " overlayer " and " screen .
 .I ewmhiwa
 causes fvwm to ignore the EWMH working area.
 .I layer
 causes the various grow methods to ignore the windows with a layer
 less than or equal to the layer on the window which is maximized.
+.I overlayer
+must have an argument;
+causes the various grow methods to ignore the windows with a layer
+less than or equal to the layer specified as the argument.
 .I screen
 must have an argument which specifies the Xinerama screen on which
 to operate.
diff -u fvwm.orig/move_resize.c fvwm/move_resize.c
--- fvwm.orig/move_resize.c	2004-03-10 13:24:29.473279360 +0100
+++ fvwm/move_resize.c	2004-03-10 15:01:52.602988624 +0100
@@ -3561,7 +3561,7 @@
 static void MaximizeHeight(
 	FvwmWindow *win, unsigned int win_width, int win_x,
 	unsigned int *win_height, int *win_y, Bool grow_up, Bool grow_down,
-	int top_border, int bottom_border, Bool layer_grow)
+	int top_border, int bottom_border, Bool layer_grow, int layer_no)
 {
 	FvwmWindow *cwin;
 	int x11, x12, x21, x22;
@@ -3582,7 +3582,9 @@
 		if (cwin == win ||
 		    (cwin->Desk != win->Desk &&
 		     !is_window_sticky_across_desks(cwin)) ||
-		    (layer_grow && cwin->layer <= win->layer))
+		    (layer_grow && 
+			 ((layer_no >= 0 && cwin->layer <= layer_no) ||
+			  (layer_no < 0 && cwin->layer <= win->layer))))
 		{
 			continue;
 		}
@@ -3632,7 +3634,7 @@
 static void MaximizeWidth(
 	FvwmWindow *win, unsigned int *win_width, int *win_x,
 	unsigned int win_height, int win_y, Bool grow_left, Bool grow_right,
-	int left_border, int right_border, Bool layer_grow)
+	int left_border, int right_border, Bool layer_grow, int layer_no)
 {
 	FvwmWindow *cwin;
 	int x11, x12, x21, x22;
@@ -3653,7 +3655,9 @@
 		if (cwin == win ||
 		    (cwin->Desk != win->Desk &&
 		     !is_window_sticky_across_desks(cwin)) ||
-		    (layer_grow && cwin->layer <= win->layer))
+		    (layer_grow && 
+			 ((layer_no >= 0 && cwin->layer <= layer_no) ||
+			  (layer_no < 0 && cwin->layer <= win->layer))))
 		{
 			continue;
 		}
@@ -3778,6 +3782,7 @@
 	Bool is_screen_given = False;
 	Bool ignore_working_area = False;
 	Bool layer_grow = False;
+	int layer_no = -1;
 	Bool global_flag_parsed = False;
 	int  scr_x, scr_y, scr_w, scr_h;
 	int sx, sy, sw, sh;
@@ -3821,6 +3826,11 @@
 				layer_grow = True;
 				action = taction;
 			}
+			else if (StrEquals(token, "overlayer"))
+			{
+				layer_grow = True;
+				GetIntegerArguments(taction, &action, &layer_no, 1);
+			}
 			else
 			{
 				global_flag_parsed = True;
@@ -3986,7 +3996,7 @@
 				fw, new_g.width, new_g.x,
 				(unsigned int *)&new_g.height, &new_g.y,
 				grow_up, grow_down, page_y + scr_y,
-				page_y + scr_y + scr_h, layer_grow);
+				page_y + scr_y + scr_h, layer_grow, layer_no);
 		}
 		else if (val2 > 0)
 		{
@@ -3999,7 +4009,7 @@
 				fw, (unsigned int *)&new_g.width, &new_g.x,
 				new_g.height, new_g.y, grow_left, grow_right,
 				page_x + scr_x, page_x + scr_x + scr_w,
-				layer_grow);
+				layer_grow, layer_no);
 		}
 		else if (val1 >0)
 		{

---

From: Rafał Bisingier <[email-masked]>
Date: Tue, 30 Mar 2004 16:12:15 +0200

Dominik Vogt wrote:
> On Sat, Mar 13, 2004 at 08:33:53PM +0100, Rafa?? Bisingier wrote:
> 
>>Hi,
>>
> I have applied the patch, but I slightly changed the syntax.  You
> can now say
> 
>   Maximize growonwindowlayer grow grow
> 
> to ignore all windows except the ones on the same layer as the
> window to be maximized and 
> 
>   Maximize growonlayers <min> <max> grow grow
> 
> to specify a range of layers.

Thanks a lot.

I found in the manpage an example which now is not correct:
Mouse 0 4 A Maximize layer grow grow

I wanted to change it to the new syntax, but I found out that I don't 
know how to get the same behavior... ;-)

-- 
Greetings
Rafal Bisingier
--
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: Dominik Vogt <[email-masked]>
Date: Tue, 30 Mar 2004 14:38:20 +0200

Ciao

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 30 Mar 2004 18:09:23 +0200

> know how to get the same behavior... ;-)

Ah, I forgot to add the $[w.layer] variable which is needed in
this case.  The new syntax is

  Mouse 0 4 A Maximize growonlayers $[w.layer] -1 grow grow

But since you want to hit only higher layers, you need some
arithmetic with piperead:

  Mouse 0 4 a Piperead \\
    "echo maximize growonlayers $$(($[w.layer]+1)) -1 grow grow"

Ciao

Dominik ^_^  ^_^

---

From: Rafał Bisingier <[email-masked]>
Date: Wed, 31 Mar 2004 09:34:32 +0200

> On Tue, Mar 30, 2004 at 04:12:15PM +0200, Rafa? Bisingier wrote:
<cut>
>     "echo maximize growonlayers $$(($[w.layer]+1)) -1 grow grow"

Thank you very much.

-- 
Greetings
Rafal Bisingier