Subject: taskbar (deskonly) patch for FvwmTaskBar in fvwm2-2.2?

From: Jordan Miles Koss <[email-masked]>
Date: Mon, 16 Aug 1999 17:23:41 -0500 (CDT)

Hi,

Has anyone written a taskbar.patch for fvwm2-2.2 that provides the
DeskOnly option for FvwmTaskBar?  I have tried adapting the patch that
came with Red Hat's fvwm2-2.0.46-12.src.rpm, but I haven't been
successful.

Thanks in advance for your help.

Jordan Koss

P.S.  I contacted Cristian Gafton at Red Hat about this issue, and he
suggested writing to this list.  If I should direct this question
elsewhere, please let me know.  Thanks.

--
[email-masked]

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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]

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 17 Aug 1999 10:21:54 +0200

> came with Red Hat's fvwm2-2.0.46-12.src.rpm, but I haven't been

Nope, I don't know of such a patch. It would be in the code if
it were there. What would such a patch be supposed to do
exactly?

Bye

Dominik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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]

---

From: Jordan Miles Koss <[email-masked]>
Date: Tue, 17 Aug 1999 07:14:46 -0500 (CDT)

Hi Dominik,

Thanks for the prompt reply.  The patch was called
fvwm-2.0.46-taskbar.patch.  There were about 15 patches in Red Hat's
fvwm2-2.0.46-12.src.rpm altogether.  This particular patch allowed one
to set the FvwmTaskBarDeskOnly flag.  (It may have fixed a few small
bugs as well.)  If the flag were then set, the taskbar would only show
the names of windows on the current desk.

Thanks again.

Jordan

--
[email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 17 Aug 1999 15:05:02 +0200

> the names of windows on the current desk.

Ah, okay. I have that patch lying around on my disk somewhere. I have
incorporated the bugfixes, but this feature was too complicated back then.
Any help is welcome.

Bye

Dominik ^_^

---

From: Jordan Miles Koss <[email-masked]>
Date: Tue, 17 Aug 1999 09:25:54 -0500 (CDT)

Hi Dominik,

Thanks again for the fast reply.  I can send you what I have so far.  
The patch sort of works, but it fails in two ways when I switch desks.
First, it doesn't always redraw the mini-icons in the taskbar buttons.
Second, when I have multiple windows open on a desk, the buttons on the
taskbar become tiny when I switch to that desk.  The buttons remain tiny
afterwards.  My guess is that somehow the count variable associated with
the buttons array goes negative, which then causes the individual
buttons to be drawn at the minimum size.  But I haven't had a chance to
test this out.

Also, the old patch had problems when a window was lauched iconified.
I guess it didn't assign the window a desk number appropriately.  I'm
not sure how to go about fixing that.

The patch also incorporates the fix that allows the Start button to pop
back up after it has been depressed.

I'll send you the patch in a separate e-mail.  I don't want to clutter
this e-mail list more than I have already.

Thanks again.

Jordan

On Tue, 17 Aug 1999, Dominik Vogt wrote:

> Ah, okay. I have that patch lying around on my disk somewhere. I
> have incorporated the bugfixes, but this feature was too complicated
> back then. Any help is welcome.

--
[email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 17 Aug 1999 18:49:56 +0200

> not sure how to go about fixing that.

Just minor problems. I've fixed dozens of this kind :-) *But* I can't
do much with a patch for 2.2 since there have been large changes in the
module interface. If you could fetch 2.3.6 from

  ftp://ftp.fvwm.org/pub/fvwm/version-2/

and convert the patch for 2.3.6 I will happily apply it and then
we kan look into the remaining bugs.

> this e-mail list more than I have already.

No, posting to the list is good. The mail will get archived then.

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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]

---

From: Jordan Miles Koss <[email-masked]>
Date: Tue, 17 Aug 1999 15:19:52 -0500 (CDT)

Hi Dominik,

Do you ever sleep?  :)

I downloaded the new version.  It will take me awhile to make the new
patch, and I don't expect having a big block of time until Thursday to
work on it.  So, I probably won't be able to get back to you until
Friday.

I can, however, offer one suggestion right away.  In
fvwm-2.3.6/modules/FvwmTaskBar/FvwmTaskBar.c, lines 275-277, the code
reads:

#ifdef FVWM95
                 | M_FUNCTION_END | M_SCROLLREGION
#endif

These two flags occur again at lines 500-518 in the same file.  However,
in the file fvwm-2.3.6/libs/Module.h, these two flags *never* get
defined.  I'm not sure where the FVWM95 macro gets defined, but if it
ever does get defined, FvwmTaskBar.c probably won't work right.  (I
think this happened to me the first time I tried creating a patch
for the taskbar...)

Jordan

--
[email-masked]

---

From: Dan Espen <[email-masked]>
Date: Tue, 17 Aug 1999 18:49:29 -0400

> think this happened to me the first time I tried creating a patch

It NEVER gets defined.  FvwmTaskbar was ported from a project
called "fvwm95".  That logic was disabled during the port.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
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]

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 27 Aug 1999 11:41:59 +0200

And another problem:

The new packet types M_SCROLLREGION and M_FUNCTION_END are
never used in fvwm, i.e. never sent to the modules. I guess
you forgot to include some file in the patch?

Bye

Dominik ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 27 Aug 1999 11:34:41 +0200

On Thu, Aug 26, 1999 at 06:23:14PM -0500, [email-masked] wrote:
> Hi Dominik,
> 
> Sorry this is a week late, but I've attached the new version of the
> patch for fvwm-2.3.6.  Since I am running Red Hat, I altered the
> previous redhat.patch and spec file;  I have included those as well.
> 
> Everything compiled OK and it ran without dumping core.  The sizes of
> the buttons were actually OK, but now I realize I didn't try making so
> many buttons that the taskbar had to start making them smaller.  That
> resizing might create a problem...
> 
> The one problem I noticed is that when switching from desk to desk, the
> taskbar didn't always appropriately refresh the text and pictures of
> buttons.  It seemed to delete them OK, and redraw the buttons themselves
> OK, but not refresh the text and mini-icon.
> 
> I'm not sure if I correctly treated the issue of checking whether a 
> particular item is sticky (line 355 of the patch).  The mode for
> checking this changed dramatically.  Actually, the change to using the
> ConfigWinPacket structures was confusing to me.  I think I got it right,
> but I am not certain.
> 
> Also, the in the past, the original patch had some problems with a
> window that I would start iconified.  I'm not sure if that has been
> fixed or not.
> 
> Regarding using fvwm-2.3.6 in general, I encountered two problems.
> First, FvwmBacker didn't work.  Either the method for setting its
> resources changed, or the way the IconPath's are read in changed.
> Second, I had programmed the arrow keys in fvwm-2.2 to move around the
> cursor if the cursor is on the background.  In fvwm-2.3.6, when the
> cursor was above a shell window, I couldn't use the arrow keys.  I don't
> know if my resource file was the culprit, or if it was something else.

I noticed one potential problem with the patch:

  --- fvwm-2.3.6/libs/Module.h.deskonly	Thu Aug 26 16:13:23 1999
  +++ fvwm-2.3.6/libs/Module.h	Thu Aug 26 16:15:16 1999
  @@ -96,7 +96,9 @@
   #define M_RESTACK            (1<<28)
   #define M_ADD_WINDOW         (1<<29)
   #define M_CONFIGURE_WINDOW   (1<<30)
  -#define MAX_MESSAGES         31
  +#define M_FUNCTION_END       (1<<31)
  +#define M_SCROLLREGION       (1<<32)
  +#define MAX_MESSAGES         33
                                ^^^^^^^

You won't be able to ever get this M_SCROLLREGION package since on
a 32 bit architecture 1<<32 is zero. 

It's not clear to me why packet types cannot simply enumerated.
To all: any comments?

Bye

Dominik ^_^

---

From: Dan Espen <[email-masked]>
Date: Fri, 27 Aug 1999 10:59:45 -0400

> It's not clear to me why packet types cannot simply enumerated.

Bits are used since modules can set up a mask for the packet types they
want.

---

From: Jordan Miles Koss <[email-masked]>
Date: Fri, 27 Aug 1999 10:59:14 -0500 (CDT)

Hi Dominik,

It looks to me like these packet types are only defined in FvwmTaskBar.c
and only inside FVWM95 #ifdefs.  If no one ever defines the FVWM95 macro
anymore, then I guess these packet types are unnecessary.  That would
solve the previous problem too.

The patch for fvwm-2.0.46 only added in these types to fvwm/module.h,
which was where these packet types were defined in that version of fvwm.
I am not aware of a patch that sends these types to the modules, but I
am not sure what it would look like.  I simply searched for SCROLLREGION
in all the patches and all the sources for the fvwm-2.0.46-5 rpm, and
only found references in FvwmTaskBar.c and the taskbar patch.

Jordan

--
[email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 27 Aug 1999 18:47:31 +0200

> only found references in FvwmTaskBar.c and the taskbar patch.

Hm, probably a remainder of fvwm95 that is not needed in fvwm.
I will commit the patch soon.

Bye

Dominik ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 27 Aug 1999 18:56:12 +0200

> know if my resource file was the culprit, or if it was something else.

Okay, the patch is in the development tree. Could you please make a patch
with entries for the NEWS file and for modules/ChangeLog?

Now let's address the problems. Please post some example configuration
I can use for testing and a short step-by-step description of how to
see the problems you mentioned (think of me as a complete idiot when
writing the instructions %-p ).

Bye

Dominik ^_^

---

From: Jordan Miles Koss <[email-masked]>
Date: Thu, 26 Aug 1999 18:23:14 -0500 (CDT)

Hi Dominik,

Thanks again.

Jordan

On Tue, 17 Aug 1999, Dominik Vogt wrote:

> we can look into the remaining bugs.
> 

--
[email-masked]

--- fvwm-2.3.6/modules/FvwmTaskBar/ButtonArray.c.deskonly	Thu Aug 26 13:55:25 1999
+++ fvwm-2.3.6/modules/FvwmTaskBar/ButtonArray.c	Thu Aug 26 14:10:07 1999
@@ -106,7 +106,7 @@
 /* -------------------------------------------------------------------------
    ButtonNew - Allocates and fills a new button structure
    ------------------------------------------------------------------------- */
-Button *ButtonNew(const char *title, Picture *p, int state)
+Button *ButtonNew(const char *title, Picture *p, int state, int count)
 {
   Button *new;
 
@@ -124,6 +124,7 @@
   }
 
   new->state = state;
+  new->count = count;
   new->next  = NULL;
   new->needsupdate = 1;
   new->iconified = 0;
@@ -187,7 +188,7 @@
 
   if ((button->p.picture != 0) &&
       (w + button->p.width + w3p + 3 > MIN_BUTTON_SIZE)) {
-
+/*        (newx + button->p.width + w3p + 3 < w)) { */
     gcm = GCClipMask | GCClipXOrigin | GCClipYOrigin;
     gcv.clip_mask = button->p.mask;
     gcv.clip_x_origin = x + 3;
@@ -321,15 +322,16 @@
 /* -------------------------------------------------------------------------
    AddButton - Allocate space for and add the button to the list
    ------------------------------------------------------------------------- */
-void AddButton(ButtonArray *array, const char *title, Picture *p, int state)
+void AddButton(ButtonArray *array, const char *title, Picture *p, int state,
+               int count)
 {
-  Button *new;
+  Button *new, *temp;
 
-  new = ButtonNew(title, p, state);
-  if (array->head == NULL) array->head = array->tail = new;
+  new = ButtonNew(title, p, state,count);
+  if (array->head == NULL) array->head = new;
   else {
-    array->tail->next = new;
-    array->tail = new;
+    for (temp=array->head; temp->next; temp=temp->next);
+    temp->next = new;
   }
   array->count++;
 
@@ -371,7 +373,9 @@
 {
   Button *temp;
 
-  temp = find_n(array, butnum);
+  for (temp=array->head; temp; temp=temp->next)
+    if (temp->count == butnum) break;
+
   return ButtonUpdate(temp, title, state);
 }
 
@@ -382,7 +386,9 @@
 {
   Button *temp;
 
-  temp = find_n(array, butnum);
+  for (temp=array->head; temp; temp=temp->next)
+    if (temp->count == butnum) break;
+
   if (temp == NULL) return -1;
   if (temp->p.picture != p->picture || temp->p.mask != p->mask) {
     temp->p.picture = p->picture;
@@ -402,29 +408,30 @@
 {
   Button *temp, *to_die;
 
-  if (butnum == 0) {
-    to_die = array->head;
-    temp = NULL;
+  if (array->head) {
+      if (array->head->count == butnum) {
+          to_die = array->head;
+          array->head = array->head->next;
+      } else {
+          for (temp=array->head, to_die=temp->next;
+               to_die;
+               to_die=to_die->next, temp=temp->next)
+              if (to_die->count == butnum) break;
+          if (to_die) temp->next = to_die->next;
+      }
+      if (to_die) temp->next = to_die->next;
   } else {
-    temp = find_n(array, butnum-1);
-    if ( !temp ) return;
-    to_die = temp->next;
-  }
-  if ( !to_die ) return;
-
-  if (array->tail == to_die)
-    array->tail = temp;
-  if ( !temp )
-    array->head = to_die->next;
-  else
-    temp->next = to_die->next;
-
-  ButtonDelete(to_die);
-  array->count--;
-  if (temp && temp != array->head)
-    temp = temp->next;
-  for (; temp; temp=temp->next)
-    temp->needsupdate = 1;
+      to_die = NULL;
+  }
+ 
+  if (to_die) {
+      ButtonDelete(to_die);
+      if (array->count > 0)
+        array->count--;
+  }
+ 
+  for (temp=array->head; temp; temp=temp->next)
+      temp->needsupdate = 1;
 
   ArrangeButtonArray(array);
 }
@@ -483,10 +490,9 @@
 void RadioButton(ButtonArray *array, int butnum, int state)
 {
   Button *button;
-  int i;
 
-  for(button=array->head,i=0; button!=NULL; button=button->next,i++) {
-    if (i == butnum) {
+  for(button=array->head; button!=NULL; button=button->next) {
+    if (button->count == butnum) {
       button->state = state;
       button->needsupdate = 1;
     } else {
@@ -539,5 +545,5 @@
     *name = NULL;
   }
 
-  return num;
+  return (num == -1) ? num : temp->count;
 }
--- fvwm-2.3.6/modules/FvwmTaskBar/ButtonArray.h.deskonly	Thu Aug 26 14:10:14 1999
+++ fvwm-2.3.6/modules/FvwmTaskBar/ButtonArray.h	Thu Aug 26 14:10:47 1999
@@ -41,7 +41,7 @@
 
 typedef struct button {
   char   *title;
-  int    state, needsupdate, truncate, iconified;
+  int    state, needsupdate, truncate, count, iconified;
   struct button *next;
   Picture p;
 } Button;
@@ -55,12 +55,13 @@
 /* Function Prototypes */
 
 void Draw3dRect(Window wn, int x, int y, int w, int h, int state);
-Button *ButtonNew(const char *title, Picture *p, int state);
+Button *ButtonNew(const char *title, Picture *p, int state, int count);
 int ButtonUpdate(Button *button, const char *title, int state);
 char *ButtonName(Button *button);
 void InitArray(ButtonArray *array, int x, int y, int w, int h, int tw);
 void UpdateArray(ButtonArray *array, int x, int y, int w, int h, int tw);
-void AddButton(ButtonArray *array, const char *title, Picture *p, int state);
+void AddButton(ButtonArray *array, const char *title, Picture *p, int state,
+               int count);
 int UpdateButton(ButtonArray *array, int butnum, const char *title, int state);
 int UpdateButtonPicture(ButtonArray *array, int butnum, Picture *p);
 void RemoveButton(ButtonArray *array, int butnum);
--- fvwm-2.3.6/modules/FvwmTaskBar/FvwmTaskBar.1.deskonly	Thu Aug 26 14:11:01 1999
+++ fvwm-2.3.6/modules/FvwmTaskBar/FvwmTaskBar.1	Thu Aug 26 14:11:33 1999
@@ -109,6 +109,10 @@
 Tells FvwmTaskBar to not show the windows that are listed on a WindowListSkip
 line in the configuration file.
 
+.IP "*FvwmTaskBarDeskOnly"
+Tells FvwmTaskBar to show the windows that are only on the current desktop.  
+When desktops are switched, the list of windows changes accordingly.
+
 .IP "*FvwmTaskBarUseIconNames"
 Tells FvwmTaskBar to use the icon name of the window instead of the full
 window name.  This is useful to keep the width of the buttons small.
--- fvwm-2.3.6/modules/FvwmTaskBar/FvwmTaskBar.c.deskonly	Thu Aug 26 14:11:37 1999
+++ fvwm-2.3.6/modules/FvwmTaskBar/FvwmTaskBar.c	Thu Aug 26 17:33:27 1999
@@ -162,12 +162,18 @@
     AutoStick      = False,
     AutoHide       = False,
     AutoFocus      = False,
-    HighlightFocus = False;
+    HighlightFocus = False,
+    DeskOnly       = False;
 
 unsigned int ScreenWidth, ScreenHeight;
 
 int NRows, RowHeight, Midline;
 
+#define COUNT_LIMIT    10000
+long DeskNumber;               /* Added by Balaji R */
+int  First = 1;
+int  Count = 0;
+
 /* Imported from Goodies */
 extern int stwin_width, goodies_width;
 extern TipStruct Tip;
@@ -271,7 +277,7 @@
   SetMessageMask(Fvwm_fd,M_ADD_WINDOW | M_CONFIGURE_WINDOW | M_DESTROY_WINDOW |
 		 M_WINDOW_NAME | M_ICON_NAME | M_RES_NAME | M_DEICONIFY |
 		 M_ICONIFY | M_END_WINDOWLIST | M_FOCUS_CHANGE |
-		 M_CONFIG_INFO | M_END_CONFIG_INFO
+		 M_CONFIG_INFO | M_END_CONFIG_INFO | M_NEW_DESK
 #ifdef FVWM95
 		 | M_FUNCTION_END | M_SCROLLREGION
 #endif
@@ -375,10 +381,13 @@
   int redraw=-1;
   int i;
   char *string;
+  long Desk;
   Picture p;
   struct ConfigWinPacket  *cfgpacket;
   unsigned long tb_flags;
 
+/*    memset(&p, 0, sizeof(Picture)); */
+
   switch(type) {
   case M_FOCUS_CHANGE:
     i = FindItem(&windows, body[0]);
@@ -415,23 +424,52 @@
       break;
     }
 
-    if (FindItem(&windows, cfgpacket->w) != -1)
+    if ((i=FindItem(&windows, cfgpacket->w)) != -1) {
+      if (GetDeskNumber(&windows,i,&Desk) && DeskOnly) {
+        if (DeskNumber != Desk && DeskNumber == cfgpacket->desk) {
+          /* window moving to current desktop */
+          AddButton(&buttons, ItemName(&windows,i), 
+                    GetItemPicture(&windows,i), BUTTON_UP, i);
+          redraw = 1;
+        }
+        if (DeskNumber != cfgpacket->desk && DeskNumber == Desk) {
+          /* window moving to another desktop */
+          RemoveButton(&buttons, i);
+          redraw = 1;
+        }
+      }
+      /* NEED TO DETERMINE IF BODY[8] IS RIGHT HERE!!! */
+      tb_flags = ItemFlags(&windows, cfgpacket->w);
+      UpdateItemFlagsDesk(&windows, cfgpacket->w, 
+                          tb_flags, cfgpacket->desk);
       break;
+    }
+
     if (!(DO_SKIP_WINDOW_LIST(cfgpacket)) || !UseSkipList) {
       AddItem(&windows,
         cfgpacket->w,
         IS_ICONIFIED(cfgpacket) ? F_ICONIFIED : 0,
-        cfgpacket);
+        cfgpacket, cfgpacket->desk, Count++);
+      if (Count > COUNT_LIMIT) Count = 0;
     }
     break;
 
   case M_DESTROY_WINDOW:
-    if ((i = DeleteItem(&windows, body[0])) == -1)
+/*      if ((i = DeleteItem(&windows, body[0])) == -1) */
+    if ((i = FindItem(&windows, body[0])) == -1)
       break;
     if (FindItem(&swallowed, body[0]) != -1)
       break;
-    RemoveButton(&buttons, i);
-    redraw = 1;
+
+    if (GetDeskNumber(&windows, i, &Desk)) {
+      DeleteItem(&windows, body[0]);
+      if (Desk == DeskNumber || !DeskOnly) {
+        RemoveButton(&buttons, i); /* what about sticky windows? */
+                                   /* problem when they are deleted */
+                                   /* from another desktop! */
+        redraw = 1;
+      }
+    }
     break;
 
 #ifdef MINI_ICONS
@@ -464,8 +502,12 @@
       break;
     if (UpdateButton(&buttons, i, string, DONT_CARE) == -1)
       {
-      AddButton(&buttons, string, NULL, BUTTON_UP);
-      redraw = 1;
+      if (GetDeskNumber(&windows, i, &Desk) == 0) return; /* ?? */
+         if (!DeskOnly || Desk == DeskNumber)
+         {
+           AddButton(&buttons, string, NULL, BUTTON_UP, i);
+           redraw = 1;
+         }
       }
     else
       redraw = 0;
@@ -518,6 +560,11 @@
 #endif /*FVWM95*/
 
   case M_NEW_DESK:
+    DeskNumber = body[0];
+    if (!First && DeskOnly)
+      redraw_buttons();
+    else
+      First = 0;
     break;
 
   case M_NEW_PAGE:
@@ -528,6 +575,65 @@
   if (redraw >= 0) RedrawWindow(redraw);
 }
 
+
+/* #define DEBUG_DESKONLY */
+
+void redraw_buttons()
+{
+  Item *item;
+
+#ifdef DEBUG_DESKONLY
+  /* print buttons.count, buttons.tw here */
+  fprintf(stderr,"Beginning of redraw_buttons()\n");
+  fprintf(stderr,"-----------------------------\n\n");
+  fprintf(stderr,"buttons.count = %i \t ",buttons.count);
+  fprintf(stderr,"buttons.tw = %i\n",buttons.tw);
+
+  fprintf(stderr,"Starting to remove old buttons...\n");
+#endif
+  while (buttons.head) {
+      RemoveButton(&buttons, buttons.head->count);
+#ifdef DEBUG_DESKONLY
+      /* print buttons.count, buttons.tw here */
+      fprintf(stderr,"buttons.count = %i \t ",buttons.count);
+      fprintf(stderr,"buttons.tw = %i\n",buttons.tw);
+#endif
+  }
+
+#ifdef DEBUG_DESKONLY
+  /* print buttons.count, buttons.tw here */
+  fprintf(stderr,"\nEnd of removing old buttons...\n\n");
+  fprintf(stderr,"Starting to add new desk buttons...\n");
+#endif
+
+  for (item=windows.head; item; item=item->next) {
+/*        if (DeskNumber == item->Desk || (item->flags & STICKY)) { */
+      /* I'm not sure if this check for sticky makes sense.  */
+      if (DeskNumber == item->Desk || (item->flags.common.is_sticky)) {
+          AddButton(&buttons, item->name, &(item->p), BUTTON_UP, item->count);
+#ifdef DEBUG_DESKONLY
+          /* print buttons.count, buttons.tw here */
+          fprintf(stderr,"buttons.count = %i \t ",buttons.count);
+          fprintf(stderr,"buttons.tw = %i\n",buttons.tw);
+#endif
+      }
+  }
+
+#ifdef DEBUG_DESKONLY
+  /* print buttons.count, buttons.tw here */
+  fprintf(stderr,"\nBefore RedrawWindow()...\n");
+#endif
+    
+  RedrawWindow(1);
+
+#ifdef DEBUG_DESKONLY
+  fprintf(stderr,"\nAfter RedrawWindow()...\n");
+  fprintf(stderr,"buttons.count = %i \t ",buttons.count);
+  fprintf(stderr,"buttons.tw = %i\n",buttons.tw);
+#endif
+}
+
+
 /******************************************************************************
   SendFvwmPipe - Send a message back to fvwm
     Based on SendInfo() from FvwmIdent:
@@ -706,6 +812,8 @@
                       Clength+12)==0) UseIconNames=True;
   else if(strncasecmp(tline,CatString3(Module, "ShowTransients",""),
                       Clength+14)==0) ShowTransients=True;
+  else if(strncasecmp(tline,CatString3(Module, "DeskOnly",""),
+                      Clength+8)==0) DeskOnly=True;
   else if(strncasecmp(tline,CatString3(Module, "UpdateInterval",""),
                       Clength+14)==0)
     UpdateInterval=atoi(&tline[Clength+14]);
@@ -920,6 +1028,12 @@
                        ItemID(&windows, num));
         }
 
+        if (MouseInStartButton(Event.xbutton.x, Event.xbutton.y)) {
+          StartButtonUpdate(NULL, BUTTON_UP);
+          redraw = 0;
+          usleep(50000);
+        }
+
         if (HighlightFocus) {
           if (num == ButPressed) RadioButton(&buttons, num, BUTTON_DOWN);
           if (num != -1) SendFvwmPipe("Focus 0", ItemID(&windows, num));
@@ -1556,12 +1670,15 @@
 void WarpTaskBar(int y) {
   win_x = win_border;
 
-  if (y < Midline)
-    win_y = win_border;
-  else
-    win_y = (int)ScreenHeight - win_height - win_border;
+  if (!AutoHide) {
+     if (y < Midline)
+       win_y = win_border;
+     else
+       win_y = (int)ScreenHeight - win_height - win_border;
+
+     XMoveWindow(dpy, win, win_x, win_y);
+  }
 
-  XMoveWindow(dpy, win, win_x, win_y);
   if (AutoHide)
     SetAlarm(HIDE_TASK_BAR);
 
@@ -1575,30 +1692,47 @@
 /***********************************************************************
  RevealTaskBar -- Make taskbar fully visible
  ***********************************************************************/
-void RevealTaskBar(void) {
+void RevealTaskBar() {
+  int new_win_y;
+
   ClearAlarm();
 
-  if (win_y < Midline)
-    win_y = win_border;
-  else
-    win_y = (int)ScreenHeight - win_height - win_border;
+  if (win_y < Midline) {
+    new_win_y = win_border;
+    for (; win_y<=new_win_y; win_y+=2)
+      XMoveWindow(dpy, win, win_x, win_y);
+  } else {
+    new_win_y = (int)ScreenHeight - win_height - win_border;
+    for (; win_y>=new_win_y; win_y-=2)
+      XMoveWindow(dpy, win, win_x, win_y);
+  }
 
-  BelayHide = False;
+  win_y = new_win_y;
   XMoveWindow(dpy, win, win_x, win_y);
+  BelayHide = False; 
 }
 
 /***********************************************************************
  HideTaskbar -- Make taskbar partially visible
  ***********************************************************************/
-void HideTaskBar(void) {
+void HideTaskBar() {
+  int new_win_y;
+
   ClearAlarm();
 
-  if (win_y < Midline)
-    win_y = 2 - win_height;
-  else
-    win_y = (int)ScreenHeight - 2;
+  if (win_y < Midline) {
+    new_win_y = 1 - win_height;
+    for (; win_y>=new_win_y; --win_y)
+      XMoveWindow(dpy, win, win_x, win_y);
+  } else {
+    new_win_y = (int)ScreenHeight - 1;
+    for (; win_y<=new_win_y; ++win_y)
+      XMoveWindow(dpy, win, win_x, win_y);
+  }
+ 
+  win_y = new_win_y;
 
-  XMoveWindow(dpy, win, win_x, win_y);
+/*    XMoveWindow(dpy, win, win_x, win_y); */
 }
 
 /***********************************************************************
--- fvwm-2.3.6/modules/FvwmTaskBar/FvwmTaskBar.h.deskonly	Thu Aug 26 15:54:01 1999
+++ fvwm-2.3.6/modules/FvwmTaskBar/FvwmTaskBar.h	Thu Aug 26 15:55:09 1999
@@ -38,6 +38,7 @@
 
 #include "config.h"
 #include "fvwm/fvwm.h"
+#include "libs/fvwmlib.h"
 #include "libs/vpacket.h"
 
 #include <X11/Xlib.h>
@@ -136,6 +137,7 @@
 extern void HideTaskBar(void);
 extern void WarpTaskBar(int x);
 extern void PurgeConfigEvents(void);
+extern void redraw_buttons(void);
 
 extern void Swallow(unsigned long *body);
 
--- fvwm-2.3.6/modules/FvwmTaskBar/Goodies.c.deskonly	Thu Aug 26 15:55:21 1999
+++ fvwm-2.3.6/modules/FvwmTaskBar/Goodies.c	Thu Aug 26 17:32:57 1999
@@ -18,6 +18,8 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <unistd.h>
+#include <string.h>
 #include <fcntl.h>
 #include <pwd.h>
 #include <time.h>
@@ -26,9 +28,12 @@
 #include <sys/types.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
+#include <X11/Xproto.h>
+#include <X11/Xatom.h>
 #include <X11/Intrinsic.h>
 #include <X11/extensions/shape.h>
 
+#include "libs/fvwmlib.h"
 #include "Goodies.h"
 #include "FvwmTaskBar.h"
 #include "Mallocs.h"
--- fvwm-2.3.6/modules/FvwmTaskBar/List.c.deskonly	Thu Aug 26 15:56:42 1999
+++ fvwm-2.3.6/modules/FvwmTaskBar/List.c	Thu Aug 26 17:32:11 1999
@@ -51,7 +51,8 @@
 /******************************************************************************
   AddItem - Allocates spaces for and appends an item to the list
 ******************************************************************************/
-void AddItem(List *list,  long id, long flags, ConfigWinPacket *cfgpacket)
+void AddItem(List *list,  long id, long flags, ConfigWinPacket *cfgpacket,
+             long Desk, int count)
 {
 Item *new;
   new=(Item *)safemalloc(sizeof(Item));
@@ -64,6 +65,8 @@
     memcpy(&new->flags, &cfgpacket->flags, sizeof(new->flags));
     }
 
+  new->Desk=Desk;
+  new->count=count;
   new->next=NULL;
   if (list->tail==NULL) list->head=list->tail=new;
   else {
@@ -101,10 +104,9 @@
 int FindItem(List *list, long id)
 {
 Item *temp;
-int i;
-  for(i=0,temp=list->head;temp!=NULL && temp->id!=id;i++,temp=temp->next);
+  for(temp=list->head;temp!=NULL && temp->id!=id;temp=temp->next);
   if (temp==NULL) return -1;
-  return i;
+  return temp->count;
 }
 
 /******************************************************************************
@@ -113,13 +115,12 @@
 int FindNameItem(List *list, char *string)
 {
   Item *temp;
-  int i;
 
-  for(i = 0, temp=list->head;
+  for(temp=list->head;
       temp!=NULL && strcmp(temp->name,string) != 0;
-      i++,temp=temp->next);
+      temp=temp->next);
   if (temp==NULL) return -1;
-  return i;
+  return temp->count;
 }
 
 /******************************************************************************
@@ -128,35 +129,42 @@
 int UpdateItemName(List *list, long id, char *string)
 {
 Item *temp;
-int i;
-  for(i=0,temp=list->head;temp!=NULL && id!=temp->id;i++,temp=temp->next);
+  for(temp=list->head;temp!=NULL && id!=temp->id;temp=temp->next);
   if (temp==NULL) return -1;
   UpdateString(&temp->name,string);
-  return i;
+  return temp->count;
 }
 
 int UpdateItemFlags(List *list, long id, long flags)
 {
 Item *temp;
-int i;
-  for(i=0,temp=list->head;temp!=NULL && id!=temp->id;i++,temp=temp->next);
+  for(temp=list->head;temp!=NULL && id!=temp->id;temp=temp->next);
   if (temp==NULL) return -1;
   if (flags!=-1) temp->tb_flags=flags;
-  return i;
+  return temp->count;
+}
+
+int UpdateItemFlagsDesk(List *list, long id, long flags, long desk)
+{
+  Item *temp;
+  for(temp=list->head;temp!=NULL && id!=temp->id;temp=temp->next);
+  if (temp==NULL) return -1;
+  if (flags!=-1) temp->tb_flags=flags;
+  temp->Desk=desk;
+  return temp->count;
 }
 
 int UpdateNameItem(List *list, char *string, long id, long flags) {
   Item *temp;
-  int i;
 
-  for(i = 0, temp=list->head;
+  for(temp=list->head;
       temp!=NULL && strcmp(temp->name,string) != 0;
-      i++,temp=temp->next);
+      temp=temp->next);
   if (temp==NULL) return -1;
   else {
     if (id != -1) temp->id = id;
     if (flags != -1) temp->tb_flags = flags;
-    return i;
+    return temp->count;
   }
 }
 
@@ -182,20 +190,24 @@
   if (list->head->id==id) {
     temp2=list->head;
     temp=list->head=list->head->next;
-    i=-1;
+    i=temp2->count;
   } else {
-    for(i=0,temp=list->head;temp->next!=NULL && temp->next->id!=id;
-      i++,temp=temp->next);
-    if (temp->next==NULL) return -1;
-    temp2=temp->next;
+     for(temp=list->head,temp2=temp->next; temp2; temp2=temp2->next) {
+      if (temp2->id == id)
+        break;
+      temp = temp2;
+    }
+    if (temp2 == NULL) return -1;
     temp->next=temp2->next;
   }
 
   if (temp2==list->tail) list->tail=temp;
 
+  i=temp2->count;
   FreeItem(temp2);
   list->count--;
-  return i+1;
+  return i;
+/*    return i+1; */
 }
 
 /******************************************************************************
@@ -235,8 +247,7 @@
 char *ItemName(List *list, int n)
 {
 Item *temp;
-int i;
-  for(i=0,temp=list->head;temp!=NULL && i<n;i++,temp=temp->next);
+  for(temp=list->head;temp!=NULL && temp->count!=n;temp=temp->next);
   if (temp==NULL) return NULL;
   return temp->name;
 }
@@ -258,8 +269,7 @@
 long ItemIndexFlags(List *list, int i)
 {
 Item *temp;
-int j;
-  for(temp=list->head, j=0;temp!=NULL && j!=i;temp=temp->next,j++);
+  for(temp=list->head;temp!=NULL && temp->count!=i;temp=temp->next);
   if (temp==NULL) return -1;
   else return temp->tb_flags;
 }
@@ -272,9 +282,8 @@
 long XorFlags(List *list, int n, long value)
 {
 Item *temp;
-int i;
 long ret;
-  for(i=0,temp=list->head;temp!=NULL && i<n;i++,temp=temp->next)
+  for(temp=list->head;temp!=NULL && i<n;temp=temp->next)
   if (temp==NULL) return -1;
   ret=temp->flags;
   temp->flags^=value;
@@ -296,8 +305,7 @@
 long ItemID(List *list, int n)
 {
 Item *temp;
-int i;
-  for(i=0,temp=list->head;temp!=NULL && i<n;i++,temp=temp->next);
+  for(temp=list->head;temp!=NULL && temp->count!=n;temp=temp->next);
   if (temp==NULL) return -1;
   return temp->id;
 }
@@ -308,14 +316,56 @@
 void CopyItem(List *dest, List *source, int n)
 {
 Item *temp;
-int i;
 ConfigWinPacket cfgpkt;
 
-  for(i=0,temp=source->head;temp!=NULL && i<n;i++,temp=temp->next);
+  for(temp=source->head;temp!=NULL && temp->count!=n;temp=temp->next);
   if (temp==NULL) return;
   memcpy(&cfgpkt.flags, &temp->flags, sizeof(cfgpkt.flags));
-  AddItem(dest, temp->id, temp->tb_flags, &cfgpkt);
+  AddItem(dest, temp->id, temp->tb_flags, &cfgpkt,temp->Desk,temp->count);
   UpdateItemName(dest,temp->id,temp->name);
   DeleteItem(source,temp->id);
 }
 
+/******************************************************************************
+  UpdateItemPicture - Adds the picture information in the list
+******************************************************************************/
+void UpdateItemPicture(List *list, int n, Picture *p)
+{
+  Item *temp;
+
+  for (temp=list->head;temp && temp->count!=n;temp=temp->next);
+  if (temp==NULL) return;
+  if (p != NULL)
+  {
+    temp->p.picture = p->picture;
+    temp->p.mask    = p->mask;
+    temp->p.width   = p->width;
+    temp->p.height  = p->height;
+    temp->p.depth   = p->depth;
+  }
+}
+
+/******************************************************************************
+  GetDeskNumber - Returns the desknumber of the item
+******************************************************************************/
+int GetDeskNumber(List *list, int n, long *Desk)
+{
+  Item *temp;
+
+  for (temp=list->head;temp && temp->count!=n;temp=temp->next);
+  if (temp==NULL) return 0;
+  *Desk=temp->Desk;
+  return 1;
+}
+
+/******************************************************************************
+  GetItemPicture - Returns the picture
+******************************************************************************/
+Picture *GetItemPicture(List *list, int n)
+{
+  Item *temp;
+
+  for (temp=list->head;temp && temp->count!=n;temp=temp->next);
+  if (temp==NULL) return 0;
+  return &(temp->p);
+}
--- fvwm-2.3.6/modules/FvwmTaskBar/List.h.deskonly	Thu Aug 26 16:09:44 1999
+++ fvwm-2.3.6/modules/FvwmTaskBar/List.h	Thu Aug 26 16:11:23 1999
@@ -38,6 +38,9 @@
   long tb_flags;
   /* The new, post-gsfr flags - for possible future use.  */
   window_flags flags;
+  long Desk;
+  int  count;
+  Picture p;
   struct item *next;
 } Item;
 
@@ -48,12 +51,14 @@
 
 /* Function Prototypes */
 void InitList(List *list);
-void AddItem(List *list, long id, long flags, ConfigWinPacket *cfgpacket);
+void AddItem(List *list, long id, long flags, ConfigWinPacket *cfgpacket,
+             long Desk, int count);
 void AddItemName(List *list, char *string, long flags);
 int FindItem(List *list, long id);
 int FindNameItem(List *list, char *string);
 int UpdateItemName(List *list, long id, char *string);
 int UpdateItemFlags(List *list, long id, long flags);
+int UpdateItemFlagsDesk(List *list, long id, long flags, long desk);
 int UpdateNameItem(List *list, char *string, long id, long flags);
 void FreeItem(Item *ptr);
 int DeleteItem(List *list,long id);
@@ -62,7 +67,10 @@
 char *ItemName(List *list, int n);
 long ItemFlags(List *list, long id );
 long ItemIndexFlags(List *list, int i);
-long XorFlags(List *list, int n, long value);
+/* long XorFlags(List *list, int n, long value); */
 int ItemCount(List *list);
 long ItemID(List *list, int n);
 void CopyItem(List *dest,List *source,int n);
+void UpdateItemPicture(List *list, int n, Picture *p);
+int GetDeskNumber(List *list, int n, long *Desk);
+Picture *GetItemPicture(List *list, int n);
--- fvwm-2.3.6/modules/FvwmTaskBar/Start.c.deskonly	Thu Aug 26 16:11:29 1999
+++ fvwm-2.3.6/modules/FvwmTaskBar/Start.c	Thu Aug 26 16:12:00 1999
@@ -69,7 +69,7 @@
   **/
   p = GetPicture(dpy, win, ImagePath, StartIconName, -1);
 
-  StartButton = (Button *)ButtonNew(StartName, p, BUTTON_UP);
+  StartButton = (Button *)ButtonNew(StartName, p, BUTTON_UP,0);
   if (p != NULL) pw = p->width+3; else pw = 0;
   StartButtonWidth = XTextWidth(ButtonFont, StartName, strlen(StartName)) +
     pw + 14;
--- fvwm-2.3.6/libs/Module.h.deskonly	Thu Aug 26 16:13:23 1999
+++ fvwm-2.3.6/libs/Module.h	Thu Aug 26 16:15:16 1999
@@ -96,7 +96,9 @@
 #define M_RESTACK            (1<<28)
 #define M_ADD_WINDOW         (1<<29)
 #define M_CONFIGURE_WINDOW   (1<<30)
-#define MAX_MESSAGES         31
+#define M_FUNCTION_END       (1<<31)
+#define M_SCROLLREGION       (1<<32)
+#define MAX_MESSAGES         33

 /**
--- fvwm-2.3.6/sample.fvwmrc/system.fvwm2rc.redhat	Thu Aug 26 13:52:00 1999
+++ fvwm-2.3.6/sample.fvwmrc/system.fvwm2rc	Thu Aug 26 13:53:33 1999
@@ -46,8 +46,6 @@
 Style "xmh"	    RandomPlacement, NoButton 2
 Style "xman"	    Icon xman.xpm, RandomPlacement, ClickToFocus
 Style "xmag"	    Icon mag_glass.xpm, RandomPlacement, ClickToFocus
-Style "xgraph"      Icon graphs.xpm, RandomPlacement, ClickToFocus
-Style "xmosaic"     Color Green/Yellow, ClickToFocus

 # some simple default key bindings:
@@ -94,8 +92,6 @@
 +			"XTerm"		Exec exec xterm
 +			"Rxvt"		Exec exec rxvt
 +			""		Nop
-+			"Remote Logins"	Popup Remote-Logins
-+			""		Nop
 +                       "Utilities"     Popup Utilities
 +			""		Nop
 +			"Fvwm Modules"	          Popup Module-Popup
@@ -114,7 +110,7 @@
 +			"Xmag"		Exec exec xmag
 +                       "Editres"       Exec exec editres
 +			""		Nop
-+			"XEmacs"	Exec exec xemacs
++			"Emacs"		Exec exec emacs
 +                       "Mail"          MailFunction xmh "-font fixed"
 +			""		Nop
 +                       "XLock"         Exec exec xlock -mode random
@@ -167,16 +163,6 @@
 +			"Print"         PrintFunction
 +                       "Print Reverse" PrintReverseFunction
 
-# be sure to fill these in with your correct machine names:
-AddToMenu Remote-Logins	"dopey"	 Exec rsh dopey rxvt -display $HOSTDISPLAY &
-+			"snoopy" Exec rsh snoopy rxvt -display $HOSTDISPLAY &
-+			"grumpy" Exec rsh grumpy rxvt -display $HOSTDISPLAY &
-+			"happy"	 Exec rsh happy rxvt -display $HOSTDISPLAY &
-+			"bailey" Exec rsh bailey rxvt -display $HOSTDISPLAY &
-+			"barnum" Exec rsh barnum rxvt -display $HOSTDISPLAY &
-+			"joker"	 Exec rsh joker rxvt -display $HOSTDISPLAY &
-+			"signal" Exec rxterm signal
-
 AddToMenu Module-Popup	"FvwmModules"	Title
 +			"Identify"	Module	FvwmIdent
 +			"Talk"  	Module	FvwmTalk
@@ -206,13 +192,7 @@
 +		      	"Restart Fvwm"	    Restart fvwm -s
 +		      	""		    Nop	
 +		      	"Start twm"         Restart twm
-+		      	"Start ctwm"        Restart ctwm
-+		        "Start tvtwm"       Restart tvtwm
-+		        "Start vtwm"        Restart vtwm
 +		      	"Start mwm"    	    Restart mwm
-+	      	      	"Start olwm"        Restart /usr/openwin/bin/olwm
-+		      	""		    Nop	
-+		      	"Start dummy"       Restart xterm
 +		      	""		    Nop	
 +		      	"No, Don't Quit"    Nop	
 
--- fvwm-2.3.6/configure.in.redhat	Thu Aug 26 13:53:49 1999
+++ fvwm-2.3.6/configure.in	Thu Aug 26 13:54:51 1999
@@ -5,8 +5,8 @@
 AM_INIT_AUTOMAKE(fvwm, 2.3.6)
 AM_CONFIG_HEADER(config.h)
 
-FVWM_MODULEDIR='${libexecdir}/${PACKAGE}/${VERSION}'
-FVWM_CONFIGDIR='${sysconfdir}/${PACKAGE}'
+FVWM_MODULEDIR='${libexecdir}'
+FVWM_CONFIGDIR='${sysconfdir}'
 
 AC_SUBST(FVWM_MODULEDIR)
 AC_SUBST(FVWM_CONFIGDIR)

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 28 Aug 1999 17:33:13 +0200

> resizing might create a problem...

No problem, it works.

> OK, but not refresh the text and mini-icon.

I have no problem with this, but I fixed two coredumps while trying
to find this. I need a config to reproduce your problem if it's still
there.

> ConfigWinPacket structures was confusing to me.  I think I got it right,

Yup, it's okay.

> window that I would start iconified.  I'm not sure if that has been

I don't see a problem with windows starting iconic.

> resources changed, or the way the IconPath's are read in changed.

The IconPath and PixmapPath commands are obsolete and have been
replaced with the ImagePath command. What is your IconPath command
(plus PixmapPath plus ImagePath)?

> cursor was above a shell window, I couldn't use the arrow keysa

It's a know problem in 2.3.6. Try a current snapshot instead.

Bye

Dominik ^_^