Subject: FvwmPager configuration

From: Austin Donnelly <[email-masked]>
Date: Wed, 17 Sep 1997 23:05:24 +0100 (BST)

Hi,

I've been playing with having a system.fvwm2rc which reads in "hook"
files from user's home directories, so that common configuration
changes can be made easily by users.  Users don't have a ~/.fvwm2rc,
but rely on the system.fvwm2rc reading the hook files they place in
their own ~/.fvwm2/ directory.  Since the users can't edit the
system.fvwm2rc file, any configuration it establishes needs to be able
to be overridden by future configuration lines read in from the
user-editable ~/.fvwm2/foo.hook files.

It's working quite well, but the FvwmPager module parses its config
options such that later *FvwmPagerXXX options don't always work
well. As an example, try:

*FvwmPagerGeometry -1-1
*FvwmPagerGeometry +50+50

as the only two *FvwmPagerGeometry lines read in your fvwm2rc.

You might expect the second to take precedence, and have a pager in
the top lefthand corner of your screen (indented 50 pixels from the
top and the left, of course).  What actually happens is that you get a
pager partially off the bottom right of the screen, as if the geometry
spec had been "-50-50".

This is due to some global variables in FvwmPager.c being initialised
explicitly when they're declared, but not re-initialised when a new
geometry spec is read.  This problem is present in fvwm version
2.0.46.

I've got a minimal patch which fixes this problem and a few other
related ones.  I've attached the patch to the end of this email.
Chuck, please could you consider it for inclusion in a future release?

It fixes:

 o the *FvwmPagerGeometry problem described above

 o similar, but for the width and height of the pager

 o the special *FvwmPagerFont of 'none' is now overridable
      by future FvwmPagerFonts (uselabel flag needed resetting)

 o a new option has been added, *FvwmPagerNoStartIconic, which turns
      off the iconic startup flag.  Also a patch to the manpage to
      document it, naturally :)

I hope you can get this stuff in to a future release, it really makes
the goal of dynamic configuration a lot easier :)

Thanks,
Austin
--- FvwmPager.c.old	Wed Sep 17 22:27:56 1997
+++ FvwmPager.c	Wed Sep 17 22:27:03 1997
@@ -886,7 +886,16 @@
 	    }
 	  tmp[strlen(tmp)-1] = 0;
 	  
+	  /* reset back to defaults in case we get multiple Geometry
+           * lines. <[email-masked]>, 1997/09/17 */
+	  usposition = 0;
+	  xneg = 0;
+	  yneg = 0;
+	  window_w = 0;
+	  window_h = 0;
+
 	  flags = XParseGeometry(tmp,&g_x,&g_y,&width,&height);
+
 	  if (flags & WidthValue) 
 	    {
 	      window_w = width;
@@ -911,7 +920,6 @@
 	    }
 	  if (flags & YNegative) 
 	    {
-	      window_y = g_y;
 	      yneg = 1;
 	    }
 	}
@@ -960,8 +968,10 @@
 	  CopyString(&font_string,&tline[Clength+5]);
 	  if(mystrncasecmp(font_string,"none",4) == 0)
 	    uselabel = 0;
-	  
+	  else
+	    uselabel = 1;	  
 	}
+
       else if((strlen(&tline[0])>1)&&
 	      (mystrncasecmp(tline, CatString3("*", MyName, "Fore"),Clength+5)==0))
 	{
@@ -1030,6 +1040,12 @@
 			     Clength+12)==0))
 	{
 	  StartIconic = 1;
+	}	
+      else if((strlen(&tline[0])>1)&&
+	      (mystrncasecmp(tline,CatString3("*",MyName,"NoStartIconic"),
+			     Clength+14)==0))
+	{
+	  StartIconic = 0;
 	}	
       else if((strlen(&tline[0])>1)&&
 	      (mystrncasecmp(tline,CatString3("*",MyName,"Rows"),
--- FvwmPager.man.old	Wed Sep 17 22:30:20 1997
+++ FvwmPager.man	Wed Sep 17 22:31:30 1997
@@ -126,6 +126,10 @@
 .IP "*FvwmPagerStartIconic"
 Causes the pager to start iconified. 
 
+.IP "*FvwmPagerNoStartIconic"
+Causes the pager to start normally.  Useful for cancelling the effect
+of the \fIStartIconic\fP option.
+
 .IP "*FvwmPagerFont \fIfont-name\fP"
 Specified a font to use to label the desktops.  If \fIfont_name\fP is
 "none" then no desktop labels will be displayed.
--
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].