Subject: FVWM: Patch: HilightBordersOnly

From: Steve Tynor <[email-masked]>
Date: Thu, 12 Dec 96 09:49:04 EST

Here's a patch to fvwm 2.0.43 that adds a new .fvwm2rc option: 

	HilightBordersOnly 

When set, it causes fvwm to use the HilightColor for the title-bar and
border relief GC, but not to change the title/border background
color. This is sort of like the standard tvtwm/twm behavior of drawing a
colored border around the active window, but not to change the title
color.  (as I detailed in a previous message, I use a wide variety of
title colors to mark different types of applications and a single
HilightColor was confusing (since all active windows ended up the same
color).

For example, I set: 

	HilightBordersOnly 
	HilightColor white red

and this causes the active window to be hilighted with a red border. 

Let me know what you think,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Writing about music is like dancing about architecture. -- Frank Zappa

Steve Tynor		Email:   [email-masked]
Tower Technology 	WWW:     http://www.twr.com/

---------- cut here ----------

*** borders.c.orig	Thu Apr 11 11:27:10 1996
--- borders.c	Tue Dec 10 23:30:09 1996
***************
*** 98,110 ****
              (Scr.Hilite !=t)&&(!(t->flags &SUPPRESSICON)))
        w = t->icon_w;
      Scr.Hilite = t;
        
!     TextColor = Scr.HiColors.fore;
!     BackPixmap= Scr.gray_pixmap;
!     BackColor = Scr.HiColors.back;
!     ReliefGC = Scr.HiReliefGC;
!     ShadowGC = Scr.HiShadowGC;
!     BorderColor = Scr.HiRelief.back;
    }
    else
    {
--- 98,134 ----
              (Scr.Hilite !=t)&&(!(t->flags &SUPPRESSICON)))
        w = t->icon_w;
      Scr.Hilite = t;
+ 
+     
+     if (Scr.HiBordersOnly) 
+     {
+       /* Hilight only the borders; not also the title */
+ 
+        TextColor =t->TextPixel;
+        BackPixmap = Scr.light_gray_pixmap;
+        if(t->flags & STICKY)
+ 	  BackPixmap = Scr.sticky_gray_pixmap;
+        BackColor = t->BackPixel;
+        Globalgcv.foreground = t->ReliefPixel;
+        Globalgcm = GCForeground;
+        XChangeGC(dpy,Scr.ScratchGC1,Globalgcm,&Globalgcv); 
+        ReliefGC = Scr.HiReliefGC; /* Scr.ScratchGC1;*/
        
!        Globalgcv.foreground = t->ShadowPixel;
!        XChangeGC(dpy,Scr.ScratchGC2,Globalgcm,&Globalgcv); 
!        ShadowGC = Scr.ScratchGC2;
! 
!        BorderColor = t->ShadowPixel;
!     }
!     else
!     {
!       TextColor = Scr.HiColors.fore;
!       BackPixmap= Scr.gray_pixmap;
!       BackColor = Scr.HiColors.back;
!       ReliefGC = Scr.HiReliefGC;
!       ShadowGC = Scr.HiShadowGC;
!       BorderColor = Scr.HiRelief.back;
!     }
    }
    else
    {
*** builtins.c.orig	Thu Jun 27 10:34:19 1996
--- builtins.c	Tue Dec 10 22:44:43 1996
***************
*** 1197,1202 ****
--- 1197,1208 ----
  }

+ void SetHiBordersOnly(XEvent *eventp,Window w,FvwmWindow *tmp_win,
+ 		unsigned long context, char *action,int* Module)
+ {
+    Scr.HiBordersOnly = 1;
+ }
+ 
  void SetHiColor(XEvent *eventp,Window w,FvwmWindow *tmp_win,
  		unsigned long context, char *action,int* Module)
  {
*** functions.c.orig	Wed Jun 19 20:01:56 1996
--- functions.c	Tue Dec 10 23:01:13 1996
***************
*** 59,64 ****
--- 59,65 ----
    {"Function",     ComplexFunction,  F_FUNCTION,            FUNC_NO_WINDOW},
    {"GotoPage",     goto_page_func,   F_GOTO_PAGE,           FUNC_NO_WINDOW},
    {"HilightColor", SetHiColor,       F_HICOLOR,             FUNC_NO_WINDOW},
+   {"HilightBordersOnly", SetHiBordersOnly, F_HIBORDER, 	    FUNC_NO_WINDOW},
    {"Iconify",      iconify_function, F_ICONIFY,             FUNC_NEEDS_WINDOW},
    {"IconFont",     LoadIconFont,     F_ICONFONT,            FUNC_NO_WINDOW},
    {"IconPath",     setIconPath,      F_ICON_PATH,           FUNC_NO_WINDOW},
*** misc.h.orig	Wed Jun 19 21:31:15 1996
--- misc.h	Tue Dec 10 22:59:56 1996
***************
*** 439,444 ****
--- 439,446 ----
  
  void ProcessNewStyle(XEvent *eventp,Window w,FvwmWindow *tmp_win,unsigned long context,
  	  char *action, int *Module);
+ void SetHiBordersOnly(XEvent *eventp,Window w,FvwmWindow *tmp_win,
+ 		      unsigned long context, char *action,int* Module);
  void SetHiColor(XEvent *eventp,Window w,FvwmWindow *tmp_win,
  		unsigned long context, char *action,int* Module);
  void SetMenuColor(XEvent *eventp,Window w,FvwmWindow *tmp_win,
*** parse.h.orig	Thu May 30 14:03:10 1996
--- parse.h	Tue Dec 10 22:40:11 1996
***************
*** 89,94 ****
--- 89,95 ----
  #define F_SEND_STRING           112
  #define F_ADD_MOD               113
  #define F_DESTROY_MOD           114
+ #define F_HIBORDER		115
  
  /* Functions for use by modules only! */
  #define F_SEND_WINDOW_LIST     1000
*** screen.h.orig	Thu Apr  4 19:18:23 1996
--- screen.h	Tue Dec 10 22:42:50 1996
***************
*** 144,149 ****
--- 144,150 ----
    ColorPair MenuStippleColors;
    ColorPair MenuRelief;
  
+   int HiBordersOnly;	/* if non-zero, Hilight the borders, but not the Title */
    ColorPair StdColors; 	/* standard fore/back colors */
    ColorPair HiColors; 	/* standard fore/back colors */
    ColorPair StdRelief;
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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].