re: FVWM: Color identified windows

From: Steve Tynor <tynor_at_atlanta.twr.com>
Date: Mon, 3 Mar 1997 14:55:22 -0500

| I use colors to identify which machine a window is connected to, I do
| this using styles and window titles.
|
| What I would like to do is that when the window is active only the title
| bar changes and the rest of the decoration stays the identifying color.
| It seems that it should be possible using .45 but I haven't been able to
| find anything that works.

It's not possible in stock fvwm2 -- however, I've patched .43 to do it
(since I use frame colors for the same purpose!). I've not had a chance
to upgrade to .45 though. My 2.0.43-based patch is attached below --
perhaps you can adapt it to .45 (shouldn't be hard). I'd really like to
see this get adopted into the baseline release...

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

Steve Tynor Email: Steve.Tynor_at_atlanta.twr.com
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 majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Mon Mar 03 1997 - 14:21:22 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:00 BST