Subject: FVWM: patch for windowlist

From: Staffan Hämälä <[email-masked]>
Date: Thu, 14 Oct 1999 20:33:47 +0200

Hi,

I was trying the newest CVS version tonight when I thought I'd
make a patch for the WindowList function so that it works the
way I would like it to do. I've added this as an option
'NoGeometryWithInfo', that does the same thing as 'NoGeometry',
but also shows information about which virtual screen each
window is positioned on, and if the window is iconified or not.

/Staffan

*** windowlist.c.old	Thu Oct 14 20:21:51 1999
--- windowlist.c	Thu Oct 14 20:28:00 1999
***************
*** 53,58 ****
--- 53,59 ----
  #define NO_DESK_SORT  (1<<6)
  #define SHOW_ICONNAME (1<<7)
  #define SHOW_ALPHABETIC (1<<8)
+ #define SHOW_INFONOTGEO (1<<9)
  #define SHOW_EVERYTHING (SHOW_GEOMETRY | SHOW_ALLDESKS | SHOW_NORMAL | SHOW_ICONIC | SHOW_STICKY)
  
  /* Function to compare window title names
***************
*** 174,179 ****
--- 175,185 ----
          flags |= SHOW_ICONNAME;
        else if (StrEquals(tok,"NoGeometry"))
          flags &= ~SHOW_GEOMETRY;
+       else if (StrEquals(tok,"NoGeometryWithInfo"))
+       {
+         flags &= ~SHOW_GEOMETRY;
+         flags |= SHOW_INFONOTGEO;
+       }
        else if (StrEquals(tok,"Geometry"))
          flags |= SHOW_GEOMETRY;
        else if (StrEquals(tok,"NoIcons"))
***************
*** 333,339 ****
          if (t->Desk != last_desk_displayed)
          {
            if (last_desk_displayed != INT_MIN)
!             if (flags & SHOW_GEOMETRY)
              AddToMenu(mr, NULL, NULL, FALSE, FALSE);
            last_desk_displayed = t->Desk;
          }
--- 339,345 ----
          if (t->Desk != last_desk_displayed)
          {
            if (last_desk_displayed != INT_MIN)
!             if ((flags & SHOW_GEOMETRY) || (flags & SHOW_INFONOTGEO))
              AddToMenu(mr, NULL, NULL, FALSE, FALSE);
            last_desk_displayed = t->Desk;
          }
***************
*** 343,350 ****
          else
            name = t->name;
          t_hot = safemalloc(strlen(name) + strlen(tname) + 48);
!         sprintf(t_hot, "&%c.  %s", scut, name); /* Generate label */
          if (scut++ == '9') scut = 'A';	/* Next shortcut key */
  
          if (flags & SHOW_GEOMETRY)
          {
--- 349,379 ----
          else
            name = t->name;
          t_hot = safemalloc(strlen(name) + strlen(tname) + 48);
! 
!         if(flags & SHOW_INFONOTGEO)
!           sprintf(t_hot, "&%c.  ", scut);         /* Generate label */
!         else
!           sprintf(t_hot, "&%c.  %s", scut, name); /* Generate label */
! 
          if (scut++ == '9') scut = 'A';	/* Next shortcut key */
+ 
+         if (flags & SHOW_INFONOTGEO)
+         {
+           tname[0]=0;
+           if(!IS_ICONIFIED(t))
+           {
+             sprintf(loc,"%d:", t->Desk);
+             strcat(tname,loc);
+           }
+           else
+             strcat(tname, "(");
+           strcat(tname, name);
+           if(IS_ICONIFIED(t))
+             strcat(tname, ")");
+           strcat(t_hot,"\t");
+           strcat(t_hot,tname);
+         }
+ 
  
          if (flags & SHOW_GEOMETRY)
          {