Subject: FVWM: FvwmPager DeskColor

From: Alan Wild <[email-masked]>
Date: Fri, 22 Dec 1995 19:28:26 -0500 (EST)

I read a post a while back about someone wished that FvwmPager would
allow you to set different color backgrounds.  This is a small patch
that I made that uses the syntax:

*FvwmPagerDeskColor <desk> <color>

to set the desk color for each desktop.  Note:  The Icon mode still uses
the color specified in *FvwmPagerBack.  If a color is not specifed for a
particuliar desk, it defaults to the value of FvwmPagerBack or to white
if the later is also not specified.  Here is a tidbit from my .fvwm2rc:

*FvwmPagerFore		#a4978e
*FvwmPagerLabel		0	main()
*FvwmPagerLabel		1	Netscape
*FvwmPagerLabel		2	Ileaf
*FvwmPagerLabel		3	other
*FvwmPagerDeskColor	0	#25383c
*FvwmPagerDeskColor	1	#413839
*FvwmPagerDeskColor	2	#610521
*FvwmPagerDeskColor	3	#052567
*FvwmPagerColumns	1
*FvwmPagerFont		-*-new century schoolbook-medium-r-*-*-10-*-*-*-*-*-*-*

-Alan

diff -c ../FvwmPager.orig/FvwmPager.c ./FvwmPager.c
*** ../FvwmPager.orig/FvwmPager.c	Tue Oct  3 11:43:19 1995
--- ./FvwmPager.c	Thu Dec 21 22:41:19 1995
***************
*** 134,139 ****
--- 134,140 ----
      {
        sprintf(line,"Desk %d",i+desk1);
        CopyString(&Desks[i].label,line);
+       CopyString(&Desks[i].Dcolor,PagerBack);
      }
    
    /* Initialize X connection */
***************
*** 894,901 ****
--- 895,923 ----
  	      (mystrncasecmp(tline,CatString3("*", MyName, "Back"),Clength+5)==0))
  	{
  	  if(Scr.d_depth > 1)
+ 	    {
  	    CopyString(&PagerBack,&tline[Clength+5]);
+ 	    for (n=0;n<ndesks;n++)
+ 	      {
+ 	        free(Desks[desk - desk1].Dcolor);
+ 	        CopyString(&Desks[n].Dcolor,PagerBack);
+ 	      }
+ 	    }
  	}	
+       else if((strlen(&tline[0])>1)&&
+ 	      (mystrncasecmp(tline,CatString3("*",MyName,"DeskColor"),Clength+10)==0))
+ 	{
+ 	  desk = desk1;
+ 	  sscanf(&tline[Clength+10],"%d",&desk);
+ 	  if((desk >= desk1)&&(desk <=desk2))
+ 	    {
+ 	      n = 0;
+ 	      while(isspace(tline[Clength+10+n]))n++;
+ 	      while(!isspace(tline[Clength+10+n]))n++;
+ 	      free(Desks[desk - desk1].Dcolor);
+ 	      CopyString(&Desks[desk - desk1].Dcolor,&tline[Clength+10+n]);
+ 	    }
+ 	}
        else if((strlen(&tline[0])>1)&&
  	      (mystrncasecmp(tline,CatString3("*",MyName,"Hilight"),Clength+8)==0))
  	{
diff -c ../FvwmPager.orig/FvwmPager.c ./FvwmPager.c../FvwmPager.orig/FvwmPager.h ./FvwmPager.h
*** ../FvwmPager.orig/FvwmPager.h	Fri Dec  2 16:06:25 1994
--- ./FvwmPager.h	Thu Dec 21 22:07:58 1995
***************
*** 70,75 ****
--- 70,76 ----
    Window CPagerWin;
    int x;
    int y;
+   char *Dcolor;
    char *label;
  } DeskInfo;
  
diff -c ../FvwmPager.orig/FvwmPager.h ./FvwmPager.h../FvwmPager.orig/x_pager.c ./x_pager.c
*** ../FvwmPager.orig/x_pager.c	Wed Nov 15 16:10:31 1995
--- ./x_pager.c	Thu Dec 21 22:41:43 1995
***************
*** 316,322 ****
        y = 0;
  
        valuemask = (CWBackPixel | CWBorderPixel | CWEventMask);
!       attributes.background_pixel = back_pix;
        attributes.border_pixel = fore_pix;
        attributes.event_mask = (ExposureMask | ButtonReleaseMask);
        Desks[i].title_w = XCreateWindow(dpy,Scr.Pager_w, x, y, w, h,1,
--- 316,322 ----
        y = 0;
  
        valuemask = (CWBackPixel | CWBorderPixel | CWEventMask);
!       attributes.background_pixel = GetColor(Desks[i].Dcolor);
        attributes.border_pixel = fore_pix;
        attributes.event_mask = (ExposureMask | ButtonReleaseMask);
        Desks[i].title_w = XCreateWindow(dpy,Scr.Pager_w, x, y, w, h,1,
-- 

   / \                                                             Alan Wild
  /---\                                                     "Speed News Guy"
 /  |  \                                [email-masked]
 -------      <a HREF="http://www.spd.louisville.edu/~arwild01">Homepage</a>

--
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].