? startshaded_window.patch
? fvwm/foo
Index: AUTHORS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/AUTHORS,v
retrieving revision 1.126
diff -u -r1.126 AUTHORS
--- AUTHORS	15 Jul 2007 12:39:39 -0000	1.126
+++ AUTHORS	30 Aug 2007 20:27:23 -0000
@@ -12,6 +12,7 @@
 Thomas Adam:
 Window style !StickyStippledTitle (and hence StickyStippledTitle).
 Icon style StippledIconTitle and !StickyStippledIconTitle.
+StartShaded style option.
 
 Serge (gentoosiast) Koksharov:
 Documentation fixes, bug fixes.
Index: ChangeLog
===================================================================
RCS file: /home/cvs/fvwm/fvwm/ChangeLog,v
retrieving revision 1.2999
diff -u -r1.2999 ChangeLog
--- ChangeLog	30 Aug 2007 06:09:34 -0000	1.2999
+++ ChangeLog	30 Aug 2007 20:27:58 -0000
@@ -1,3 +1,8 @@
+2007-08-30 Thomas Adam <thomas@edulinux.homeunix.org>
+    * fvwm/style.c:
+    * fvwm/add_window.c:
+      Added new style option:  StartShaded.
+
 2007-08-30  Viktor Griph  <griph(at)student(dot)chalmers(dot)se>
 
 	* configure.ac:
Index: doc/commands/Style.xml
===================================================================
RCS file: /home/cvs/fvwm/fvwm/doc/commands/Style.xml,v
retrieving revision 1.4
diff -u -r1.4 Style.xml
--- doc/commands/Style.xml	16 Jun 2007 12:38:46 -0000	1.4
+++ doc/commands/Style.xml	30 Aug 2007 20:28:05 -0000
@@ -160,7 +160,7 @@
 <emphasis remap='I'>FPReleaseFocus</emphasis> / <emphasis remap='I'>!FPReleaseFocus</emphasis>,
 <emphasis remap='I'>!FPReleaseFocusTransient</emphasis> / <emphasis remap='I'>FPReleaseFocusTransient</emphasis>,
 <emphasis remap='I'>FPOverrideReleaseFocus</emphasis> / <emphasis remap='I'>!FPOverrideReleaseFocus</emphasis>,
-<emphasis remap='I'>StartsLowered</emphasis> / <emphasis remap='I'>StartsRaised</emphasis>,
+<emphasis remap='I'>StartsLowered</emphasis> / <emphasis remap='I'>StartShaded</emphasis> / <emphasis remap='I'>StartsRaised</emphasis>,
 <emphasis remap='I'>IgnoreRestack</emphasis> / <emphasis remap='I'>AllowRestack</emphasis>,
 <emphasis remap='I'>FixedPosition</emphasis> / <emphasis remap='I'>VariablePosition</emphasis>,
 <emphasis remap='I'>FixedUSPosition</emphasis> / <emphasis remap='I'>VariableUSPosition</emphasis>,
@@ -1720,6 +1720,20 @@
 layer rather than the default
 <fvwmopt cmd="Style" opt="StartsRaised"/>.</para>
 
+<para><fvwmopt cmd="Style" opt="StartShaded"/>
+tells fvwm to shade the window.  An optional direction argument may be
+given, which can be one of
+"<fvwmopt cmd="WindowShade" opt="North"/>",
+"<fvwmopt cmd="WindowShade" opt="South"/>",
+"<fvwmopt cmd="WindowShade" opt="West"/>",
+"<fvwmopt cmd="WindowShade" opt="East"/>",
+"<fvwmopt cmd="WindowShade" opt="NorthWest"/>",
+"<fvwmopt cmd="WindowShade" opt="NorthEast"/>",
+"<fvwmopt cmd="WindowShade" opt="SouthWest"/>",
+"<fvwmopt cmd="WindowShade" opt="SouthEast"/>" or
+"<fvwmopt cmd="WindowShade" opt="Last"/>"
+if no direction is given, the default is to shade to north.</para>
+
 <para><emphasis remap='I'>SkipMapping</emphasis>
 tells fvwm not to switch to the desk the window is on when it gets
 mapped initially (useful with
@@ -2173,5 +2187,4 @@
 
 </section>
 
-
 </section>
Index: fvwm/add_window.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/add_window.c,v
retrieving revision 1.392
diff -u -r1.392 add_window.c
--- fvwm/add_window.c	7 Aug 2007 20:17:43 -0000	1.392
+++ fvwm/add_window.c	30 Aug 2007 20:28:13 -0000
@@ -2479,7 +2479,7 @@
 	GNOME_SetWinArea(fw);
 
 	/****** windowshade ******/
-	if (state_args.do_shade)
+	if (state_args.do_shade || SDO_START_SHADED(sflags))
 	{
 		rectangle big_g;
 		rectangle new_g;
@@ -2489,6 +2489,14 @@
 		{
 			state_args.shade_dir = GET_TITLE_DIR(fw);
 		}
+                
+                /* If we've set a style for StartShaded, ensure we override
+                 * the state for it here.
+                 */
+                if( SGET_STARTS_SHADED_DIR(style) != DIR_NONE )
+                {
+                        state_args.shade_dir = SGET_STARTS_SHADED_DIR(style);
+                }
 		big_g = (IS_MAXIMIZED(fw)) ? fw->g.max : fw->g.frame;
 		new_g = big_g;
 		get_shaded_geometry_with_dir(
Index: fvwm/fvwm.h
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/fvwm.h,v
retrieving revision 1.256
diff -u -r1.256 fvwm.h
--- fvwm/fvwm.h	3 Jun 2007 09:28:34 -0000	1.256
+++ fvwm/fvwm.h	30 Aug 2007 20:28:15 -0000
@@ -531,6 +531,7 @@
 	unsigned do_save_under : 1;
 	unsigned do_start_iconic : 1;
 	unsigned do_start_lowered : 1;
+ 	unsigned do_start_shaded : 1;
 	unsigned has_border_width : 1;
 	unsigned has_color_back : 1;
 	unsigned has_color_fore : 1;
@@ -648,6 +649,7 @@
 	int start_page_x;
 	int start_page_y;
 	int start_screen;
+	int start_shaded_dir;
 	int min_window_width;
 	int min_window_height;
 	int max_window_width;
Index: fvwm/style.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/style.c,v
retrieving revision 1.256
diff -u -r1.256 style.c
--- fvwm/style.c	3 Jun 2007 09:28:34 -0000	1.256
+++ fvwm/style.c	30 Aug 2007 20:28:25 -0000
@@ -585,6 +585,11 @@
 	{
 		SSET_LAYER(*merged_style, SGET_LAYER(*add_style));
 	}
+        if (add_style->flags.do_start_shaded)
+        {
+                SSET_STARTS_SHADED_DIR(*merged_style, 
+                                SGET_STARTS_SHADED_DIR(*add_style));
+        }
 	if (add_style->flags.use_colorset)
 	{
 		SSET_COLORSET(*merged_style, SGET_COLORSET(*add_style));
@@ -3784,6 +3789,28 @@
 			ps->flag_mask.do_start_lowered = 1;
 			ps->change_mask.do_start_lowered = 1;
 		}
+                else if (StrEquals(token, "StartShaded"))
+                {
+                        token = PeekToken(rest, &rest);
+
+                        if( token )
+                        {
+                                direction_t direction;
+
+                                direction = gravity_parse_dir_argument( token, &token, DIR_NONE );
+
+                                if (direction >= 0 && direction <= DIR_MAJOR_MASK)
+                                {
+                                        SSET_STARTS_SHADED_DIR(*ps, direction);
+                                }
+                        } else {
+                                SSET_STARTS_SHADED_DIR(*ps, DIR_NONE);
+                        }
+
+                        ps->flags.do_start_shaded = on;
+                        ps->flag_mask.do_start_shaded = 1;
+                        ps->change_mask.do_start_shaded = 1;
+                }
 		else if (StrEquals(token, "SaveUnder"))
 		{
 			ps->flags.do_save_under = on;
Index: fvwm/style.h
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/style.h,v
retrieving revision 1.87
diff -u -r1.87 style.h
--- fvwm/style.h	3 Jun 2007 09:28:34 -0000	1.87
+++ fvwm/style.h	30 Aug 2007 20:28:26 -0000
@@ -11,6 +11,8 @@
 	((sf)->do_save_under)
 #define SDO_START_LOWERED(sf) \
 	((sf)->do_start_lowered)
+#define SDO_START_SHADED(sf) \
+    ((sf)->do_start_shaded)
 #define SHAS_BORDER_WIDTH(sf) \
 	((sf)->has_border_width)
 #define SHAS_COLOR_BACK(sf) \
@@ -509,6 +511,10 @@
 	((s).start_screen)
 #define SSET_START_SCREEN(s,x) \
 	((s).start_screen = (x))
+#define SSET_STARTS_SHADED_DIR(s,x) \
+    ((s).start_shaded_dir = (x))
+#define SGET_STARTS_SHADED_DIR(s) \
+    ((s).start_shaded_dir)
 #define SGET_MIN_ICON_WIDTH(s) \
 	((s).min_icon_width)
 #define SSET_MIN_ICON_WIDTH(s,x) \
