Hello, another one: ResizeOutlineThin

-- 
Jesús Guerrero <[EMAIL PROTECTED]>
Index: fvwm/style.c
===================================================================
--- fvwm/style.c	(revision 2)
+++ fvwm/style.c	(revision 3)
@@ -3513,6 +3513,12 @@
 			S_SET_DO_RESIZE_OPAQUE(SCM(*ps), 1);
 			S_SET_DO_RESIZE_OPAQUE(SCC(*ps), 1);
 		}
+		else if (StrEquals(token, "ResizeOutlineThin"))
+		{
+			S_SET_DO_RESIZE_OUTLINE_THIN(SCF(*ps), on);
+			S_SET_DO_RESIZE_OUTLINE_THIN(SCM(*ps), 1);
+			S_SET_DO_RESIZE_OUTLINE_THIN(SCC(*ps), 1);
+		}
 		else if (StrEquals(token, "RightTitleRotatedCW"))
 		{
 			S_SET_IS_RIGHT_TITLE_ROTATED_CW(SCF(*ps), on);
Index: fvwm/style.h
===================================================================
--- fvwm/style.h	(revision 2)
+++ fvwm/style.h	(revision 3)
@@ -197,6 +197,10 @@
 	((c).s.do_resize_opaque)
 #define S_SET_DO_RESIZE_OPAQUE(c,x) \
 	((c).s.do_resize_opaque = !!(x))
+#define S_DO_RESIZE_OUTLINE_THIN(c) \
+	((c).s.do_resize_outline_thin)
+#define S_SET_DO_RESIZE_OUTLINE_THIN(c,x) \
+	((c).s.do_resize_outline_thin = !!(x))
 #define S_DO_SHRINK_WINDOWSHADE(c) \
 	((c).s.do_shrink_windowshade)
 #define S_SET_DO_SHRINK_WINDOWSHADE(c,x) \
Index: fvwm/move_resize.c
===================================================================
--- fvwm/move_resize.c	(revision 2)
+++ fvwm/move_resize.c	(revision 3)
@@ -112,7 +112,7 @@
 
 extern Window PressedW;
 
-static void draw_move_resize_grid(int x, int  y, int  width, int height);
+static void draw_move_resize_grid(int x, int  y, int  width, int height, Bool thin);
 
 /* ----- end of resize globals ----- */
 
@@ -130,27 +130,34 @@
  *
  */
 static int get_outline_rects(
-	XRectangle *rects, int x, int y, int width, int height)
+	XRectangle *rects, int x, int y, int width, int height, Bool do_outline_thin)
 {
 	int i;
 	int n;
 	int m;
 
-	n = 3;
-	m = (width - 5) / 2;
-	if (m < n)
+	if (do_outline_thin)
 	{
-		n = m;
+		n = 1;
 	}
-	m = (height - 5) / 2;
-	if (m < n)
+	else
 	{
-		n = m;
+		n = 3;
+		m = (width - 5) / 2;
+		if (m < n)
+		{
+			n = m;
+		}
+		m = (height - 5) / 2;
+		if (m < n)
+		{
+			n = m;
+		}
+		if (n < 1)
+		{
+			n = 1;
+		}
 	}
-	if (n < 1)
-	{
-		n = 1;
-	}
 
 	for (i = 0; i < n; i++)
 	{
@@ -159,26 +166,29 @@
 		rects[i].width = width - (i << 1);
 		rects[i].height = height - (i << 1);
 	}
-	if (width - (n << 1) >= 5 && height - (n << 1) >= 5)
+	if (!do_outline_thin)
 	{
-		if (width - (n << 1) >= 10)
+		if (width - (n << 1) >= 5 && height - (n << 1) >= 5)
 		{
-			int off = (width - (n << 1)) / 3 + n;
-			rects[i].x = x + off;
-			rects[i].y = y + n;
-			rects[i].width = width - (off << 1);
-			rects[i].height = height - (n << 1);
-			i++;
+			if (width - (n << 1) >= 10)
+			{
+				int off = (width - (n << 1)) / 3 + n;
+				rects[i].x = x + off;
+				rects[i].y = y + n;
+				rects[i].width = width - (off << 1);
+				rects[i].height = height - (n << 1);
+				i++;
+			}
+			if (height - (n << 1) >= 10)
+			{
+				int off = (height - (n << 1)) / 3 + n;
+				rects[i].x = x + n;
+				rects[i].y = y + off;
+				rects[i].width = width - (n << 1);
+				rects[i].height = height - (off << 1);
+				i++;
+			}
 		}
-		if (height - (n << 1) >= 10)
-		{
-			int off = (height - (n << 1)) / 3 + n;
-			rects[i].x = x + n;
-			rects[i].y = y + off;
-			rects[i].width = width - (n << 1);
-			rects[i].height = height - (off << 1);
-			i++;
-		}
 	}
 
 	return i;
@@ -190,14 +200,15 @@
 	struct
 	{
 		unsigned is_enabled : 1;
+		unsigned do_outline_thin : 1;
 	} flags;
 } move_resize_grid =
 {
 	{ 0, 0, 0, 0 },
-	{ 0 }
+	{ 0, 0 }
 };
 
-static void draw_move_resize_grid(int x, int  y, int  width, int height)
+static void draw_move_resize_grid(int x, int  y, int  width, int height, Bool do_outline_thin)
 {
 	int nrects = 0;
 	XRectangle rects[10];
@@ -206,7 +217,8 @@
 	    x == move_resize_grid.geom.x &&
 	    y == move_resize_grid.geom.y &&
 	    width == move_resize_grid.geom.width &&
-	    height == move_resize_grid.geom.height)
+	    height == move_resize_grid.geom.height &&
+		do_outline_thin == move_resize_grid.flags.do_outline_thin)
 	{
 		return;
 	}
@@ -224,7 +236,8 @@
 				&(rects[0]), move_resize_grid.geom.x,
 				move_resize_grid.geom.y,
 				move_resize_grid.geom.width,
-				move_resize_grid.geom.height);
+				move_resize_grid.geom.height,
+				move_resize_grid.flags.do_outline_thin);
 	}
 	if (width && height)
 	{
@@ -233,8 +246,9 @@
 		move_resize_grid.geom.y = y;
 		move_resize_grid.geom.width = width;
 		move_resize_grid.geom.height = height;
+		move_resize_grid.flags.do_outline_thin = do_outline_thin;
 		nrects += get_outline_rects(
-			&(rects[nrects]), x, y, width, height);
+			&(rects[nrects]), x, y, width, height, do_outline_thin);
 	}
 	if (nrects > 0)
 	{
@@ -251,7 +265,7 @@
 	{
 		if (move_resize_grid.flags.is_enabled)
 		{
-			draw_move_resize_grid(0, 0, 0, 0);
+			draw_move_resize_grid(0, 0, 0, 0, 0);
 		}
 		else
 		{
@@ -259,6 +273,7 @@
 			move_resize_grid.geom.y = 0;
 			move_resize_grid.geom.width = 0;
 			move_resize_grid.geom.height = 0;
+			move_resize_grid.flags.do_outline_thin = 0;
 		}
 	}
 	else if (!move_resize_grid.flags.is_enabled)
@@ -270,7 +285,8 @@
 				move_resize_grid.geom.x,
 				move_resize_grid.geom.y,
 				move_resize_grid.geom.width,
-				move_resize_grid.geom.height);
+				move_resize_grid.geom.height,
+				move_resize_grid.flags.do_outline_thin);
 		}
 	}
 
@@ -2281,6 +2297,7 @@
 	/* Must not set placed by button if the event is a modified KeyEvent */
 	Bool is_fake_event;
 	FvwmWindow *fw = exc->w.fw;
+	Bool do_outline_thin = DO_RESIZE_OUTLINE_THIN(fw);
 	unsigned int draw_parts = PART_NONE;
 	XEvent e;
 
@@ -2354,7 +2371,7 @@
 	if (!IS_ICONIFIED(fw) &&
 	    ((!do_move_opaque && !Scr.gs.do_emulate_mwm) || !IS_MAPPED(fw)))
 	{
-		draw_move_resize_grid(xl, yt, Width - 1, Height - 1);
+		draw_move_resize_grid(xl, yt, Width - 1, Height - 1, do_outline_thin);
 	}
 
 	if (move_w == FW_W_FRAME(fw) && do_move_opaque)
@@ -2682,7 +2699,7 @@
 				if (!do_move_opaque)
 				{
 					draw_move_resize_grid(
-						xl, yt, Width - 1, Height - 1);
+						xl, yt, Width - 1, Height - 1, do_outline_thin);
 				}
 				else
 				{
@@ -2753,7 +2770,7 @@
 			if (!do_move_opaque)
 			{
 				draw_move_resize_grid(
-					xl, yt, Width - 1, Height - 1);
+					xl, yt, Width - 1, Height - 1, do_outline_thin);
 			}
 			break;
 
@@ -3286,7 +3303,7 @@
 static void __resize_step(
 	const exec_context_t *exc, int x_root, int y_root, int *x_off,
 	int *y_off, rectangle *drag, const rectangle *orig, int *xmotionp,
-	int *ymotionp, Bool do_resize_opaque, Bool is_direction_fixed)
+	int *ymotionp, Bool do_resize_opaque, Bool is_direction_fixed, Bool do_outline_thin)
 {
 	int action = 0;
 	XEvent e;
@@ -3409,7 +3426,7 @@
 		{
 			draw_move_resize_grid(
 				drag->x, drag->y, drag->width - 1,
-				drag->height - 1);
+				drag->height - 1, do_outline_thin);
 		}
 		else
 		{
@@ -3469,6 +3486,7 @@
 	int x_off;
 	int y_off;
 	direction_t dir;
+	Bool do_outline_thin = DO_RESIZE_OUTLINE_THIN(fw);
 
 	bad_window = False;
 	ResizeWindow = FW_W_FRAME(fw);
@@ -3772,7 +3790,7 @@
 	if (!do_resize_opaque)
 	{
 		draw_move_resize_grid(
-			drag->x, drag->y, drag->width - 1, drag->height - 1);
+			drag->x, drag->y, drag->width - 1, drag->height - 1, do_outline_thin);
 	}
 	/* kick off resizing without requiring any motion if invoked with a key
 	 * press */
@@ -3793,7 +3811,7 @@
 		yo = 0;
 		__resize_step(
 			exc, stashed_x, stashed_y, &xo, &yo, drag, orig,
-			&xmotion, &ymotion, do_resize_opaque, True);
+			&xmotion, &ymotion, do_resize_opaque, True, do_outline_thin);
 	}
 	else
 	{
@@ -3957,7 +3975,7 @@
 				__resize_step(
 					exc, x, y, &x_off, &y_off, drag, orig,
 					&xmotion, &ymotion, do_resize_opaque,
-					is_direction_fixed);
+					is_direction_fixed, do_outline_thin);
 				/* need to move the viewport */
 				HandlePaging(
 					&ev, dx, dy, &x, &y, &delta_x,
@@ -3974,7 +3992,7 @@
 				__resize_step(
 					exc, x, y, &x_off, &y_off, drag, orig,
 					&xmotion, &ymotion, do_resize_opaque,
-					is_direction_fixed);
+					is_direction_fixed, do_outline_thin);
 			}
 			fForceRedraw = False;
 			is_done = True;
@@ -4009,7 +4027,7 @@
 			{
 				draw_move_resize_grid(
 					drag->x, drag->y, drag->width - 1,
-					drag->height - 1);
+					drag->height - 1, do_outline_thin);
 			}
 		}
 		else
@@ -4062,7 +4080,7 @@
 			g = sorig;
 			__resize_step(
 				exc, sorig.x, sorig.y, &xo, &yo, &g, orig,
-				&xmotion, &ymotion, do_resize_opaque, True);
+				&xmotion, &ymotion, do_resize_opaque, True, do_outline_thin);
 		}
 		if (vx != Scr.Vx || vy != Scr.Vy)
 		{
Index: fvwm/fvwm.h
===================================================================
--- fvwm/fvwm.h	(revision 2)
+++ fvwm/fvwm.h	(revision 3)
@@ -223,6 +223,7 @@
 		unsigned do_not_show_on_map : 1;
 		unsigned do_raise_transient : 1;
 		unsigned do_resize_opaque : 1;
+		unsigned do_resize_outline_thin : 1;
 		unsigned do_shrink_windowshade : 1;
 		unsigned do_stack_transient_parent : 1;
 		unsigned do_window_list_skip : 1;
Index: fvwm/window_flags.h
===================================================================
--- fvwm/window_flags.h	(revision 2)
+++ fvwm/window_flags.h	(revision 3)
@@ -21,6 +21,8 @@
 	((fw)->flags.common.s.do_raise_transient)
 #define DO_RESIZE_OPAQUE(fw) \
 	((fw)->flags.common.s.do_resize_opaque)
+#define DO_RESIZE_OUTLINE_THIN(fw) \
+	((fw)->flags.common.s.do_resize_outline_thin)
 #define DO_SHRINK_WINDOWSHADE(fw) \
 	((fw)->flags.common.s.do_shrink_windowshade)
 #define SET_DO_SHRINK_WINDOWSHADE(fw,x) \

Reply via email to