Subject: EWMH and Maximize growonwindowlayer patch

From: Arnaud Vrac <[email-masked]>
Date: Tue, 14 Dec 2004 01:19:27 +0100

In my config i have:

EwmhBaseStruts 0 0 20 0
Style * EWMHUseStrutHints, EWMHPlacementUseWorkingArea

Mouse   1       4       A       Maximize growonwindowlayer grow grow

However when i maximize a window the EWMH area is covered. That should 
only happen if ewmhiwa is set on Maximize. Correct me if this is not 
true, anyway i attached a patch that applies against cvs.

--
Arnaud Vrac
diff -Nur fvwm-2.5.12-orig/fvwm/move_resize.c fvwm-2.5.12/fvwm/move_resize.c
--- fvwm-2.5.12-orig/fvwm/move_resize.c	2004-09-27 11:33:04.000000000 +0200
+++ fvwm-2.5.12/fvwm/move_resize.c	2004-10-27 22:22:34.807981792 +0200
@@ -4090,7 +4090,6 @@
 	int layers[2] = { -1, -1 };
 	Bool global_flag_parsed = False;
 	int  scr_x, scr_y, scr_w, scr_h;
-	int sx, sy, sw, sh;
 	rectangle new_g;
 	FvwmWindow *fw = exc->w.fw;
 
@@ -4180,14 +4179,10 @@
 			&fscr, FSCREEN_XYPOS, &scr_x, &scr_y, &scr_w, &scr_h);
 	}
 
-	sx = scr_x;
-	sy = scr_y;
-	sw = scr_w;
-	sh = scr_h;
 	if (!ignore_working_area)
 	{
 		EWMH_GetWorkAreaIntersection(
-			fw, &sx, &sy, &sw, &sh, EWMH_MAXIMIZE_MODE(fw));
+			fw, &scr_x, &scr_y, &scr_w, &scr_h, EWMH_MAXIMIZE_MODE(fw));
 	}
 #if 0
 	fprintf(stderr, "%s: page=(%d,%d), scr=(%d,%d, %dx%d)\n", __FUNCTION__,
@@ -4195,7 +4190,6 @@
 #endif
 
 	/* parse first parameter */
-	val1_unit = sw;
 	token = PeekToken(action, &taction);
 	if (token && StrEquals(token, "grow"))
 	{
@@ -4221,24 +4235,23 @@
 		if (GetOnePercentArgument(token, &val1, &val1_unit) == 0)
 		{
 			val1 = 100;
-			val1_unit = sw;
+			val1_unit = scr_w;
 		}
 		else if (val1 < 0)
 		{
 			/* handle negative offsets */
-			if (val1_unit == sw)
+			if (val1_unit == scr_w)
 			{
 				val1 = 100 + val1;
 			}
 			else
 			{
-				val1 = sw + val1;
+				val1 = scr_w + val1;
 			}
 		}
 	}
 
 	/* parse second parameter */
-	val2_unit = sh;
 	token = PeekToken(taction, NULL);
 	if (token && StrEquals(token, "grow"))
 	{
@@ -4264,33 +4257,22 @@
 		if (GetOnePercentArgument(token, &val2, &val2_unit) == 0)
 		{
 			val2 = 100;
-			val2_unit = sh;
+			val2_unit = scr_h;
 		}
 		else if (val2 < 0)
 		{
 			/* handle negative offsets */
-			if (val2_unit == sh)
+			if (val2_unit == scr_h)
 			{
 				val2 = 100 + val2;
 			}
 			else
 			{
-				val2 = sh + val2;
+				val2 = scr_h + val2;
 			}
 		}
 	}
 
-	if (!grow_left && !grow_right)
-	{
-		scr_x = sx;
-		scr_w = sw;
-	}
-	if (!grow_up && !grow_down)
-	{
-		scr_y = sy;
-		scr_h = sh;
-	}
-
 #if 0
 	fprintf(stderr, "%s: page=(%d,%d), scr=(%d,%d, %dx%d)\n", __FUNCTION__,
 		page_x, page_y, scr_x, scr_y, scr_w, scr_h);