*** FvwmIconBox.c.orig	Mon Jul 25 21:51:54 1994
--- FvwmIconBox.c	Thu Aug  4 10:29:47 1994
***************
*** 990,996 ****
    /* icon_win's background */
    if (GetBackPixmap() == True){
      XSetWindowBackgroundPixmap(dpy, icon_win, IconwinPixmap);
!     XFree(&IconwinPixmap);
    }
  
    XSetForeground(dpy, NormalGC, icon_fore_pix);
--- 990,998 ----
    /* icon_win's background */
    if (GetBackPixmap() == True){
      XSetWindowBackgroundPixmap(dpy, icon_win, IconwinPixmap);
!     /*  special thanks to Dave Goldberg <dsg@mitre.org> 
! 	for his helpful information */
!     XFreePixmap(dpy, IconwinPixmap);
    }
  
    XSetForeground(dpy, NormalGC, icon_fore_pix);
***************
*** 1939,1945 ****
      if (isendlist)
        break;
    case M_ADD_WINDOW:
!     if (AddItem(body[0], body[8]) == True && UP){
        GetIconwinSize(&diffx, &diffy);
        if (diffy && (primary == BOTTOM || secondary == BOTTOM))
  	icon_win_y += diffy;
--- 1941,1947 ----
      if (isendlist)
        break;
    case M_ADD_WINDOW:
!     if (AddItem(body[0], body[1], body[8]) == True && UP){
        GetIconwinSize(&diffx, &diffy);
        if (diffy && (primary == BOTTOM || secondary == BOTTOM))
  	icon_win_y += diffy;
***************
*** 1990,1996 ****
        isndeleted = LookInList(tmp);
      if (UP && isndeleted && tmp != NULL){
        CreateIconWindow(tmp);
!       ConfigureIconWindow(tmp, 0);
        XMapWindow(dpy, tmp->icon_pixmap_w);       
        XMapWindow(dpy, tmp->IconWin);       
        tmp = Head;
--- 1992,1998 ----
        isndeleted = LookInList(tmp);
      if (UP && isndeleted && tmp != NULL){
        CreateIconWindow(tmp);
!       ConfigureIconWindow(tmp, isndeleted);
        XMapWindow(dpy, tmp->icon_pixmap_w);       
        XMapWindow(dpy, tmp->IconWin);       
        tmp = Head;
***************
*** 2103,2109 ****
   *	Skeleton based on AddItem() from FvwmWinList:
   *		Copyright 1994, Mike Finger.
   ***********************************************************************/
! Bool AddItem(unsigned long id, unsigned long flags)
  {
    struct icon_info *new, *tmp;
    tmp = Head;
--- 2105,2111 ----
   *	Skeleton based on AddItem() from FvwmWinList:
   *		Copyright 1994, Mike Finger.
   ***********************************************************************/
! Bool AddItem(unsigned long id, unsigned long fid, unsigned long flags)
  {
    struct icon_info *new, *tmp;
    tmp = Head;
***************
*** 2134,2139 ****
--- 2136,2142 ----
    new->icon_pixmap_w = None;  
    new->icon_depth = 0;
    new->id = id;
+   new->fid = fid;
    new->flags = flags | ICON_OURS;
    new->wmhints = NULL;
    new->prev = NULL;
***************
*** 2345,2353 ****
      free(item->res_name);
    if (item->res_class != NULL)
      free(item->res_class);
!   XFree(item->wmhints);
    if (item->iconPixmap != None)
!     XFree(&item->iconPixmap);
    free(item);
  }
  
--- 2348,2357 ----
      free(item->res_name);
    if (item->res_class != NULL)
      free(item->res_class);
!   if (item->wmhints != NULL)
!     XFree(item->wmhints);
    if (item->iconPixmap != None)
!     XFreePixmap(dpy, item->iconPixmap);
    free(item);
  }
  
***************
*** 2491,2498 ****
    char *value=NULL;
    struct iconfile *nptr;
  
-   item->wmhints = XGetWMHints(dpy, item->id);
- 
    for (nptr = IconListHead; nptr != NULL; nptr = nptr->next){
      if (nptr == DefaultIcon)
        isdefault = 1;
--- 2495,2500 ----
***************
*** 2518,2525 ****
  
    if (!isdefault)
      item->icon_file = value;
-   else if((item->wmhints) &&(item->wmhints->flags & IconPixmapHint))
-      item->icon_file  = NULL;
    else if (DefaultIcon != NULL)
      item->icon_file = DefaultIcon->iconfile;
    
--- 2520,2525 ----
***************
*** 2528,2534 ****
      DeleteItem(item->id);
      return 0;
    }
!   return 1;
  }
  
  /***********************************************************************
--- 2528,2534 ----
      DeleteItem(item->id);
      return 0;
    }
!   return (isdefault == 0 ? 1 : 2);
  }
  
  /***********************************************************************
*** FvwmIconBox.h.orig	Thu Jul 14 00:51:05 1994
--- FvwmIconBox.h	Tue Aug  2 15:03:24 1994
***************
*** 21,27 ****
  extern FVWM_INLINE void RelieveWindow(Window win,int x,int y,int w,int h,GC rGC,GC sGC);
  extern void   SendFvwmPipe(int *,char *text, unsigned long window);
  extern void   DeadPipe(int nonsense);
- extern void   LoadIconFile(struct icon_info *item);
  extern void   CreateIconWindow(struct icon_info *item);
  extern void   ConfigureIconWindow(struct icon_info *item, int);
  extern void   DrawIconWindow(struct icon_info *item);
--- 21,26 ----
***************
*** 32,38 ****
  extern void GetIconBitmap(struct icon_info *item);
  extern void process_message(unsigned long type,unsigned long *body);
  extern void send_clientmessage (Window w, Atom a, Time timestamp);
! extern Bool AddItem(unsigned long id, unsigned long flags);
  extern Bool DeleteItem(unsigned long id);
  extern struct icon_info *UpdateItem(unsigned long type, unsigned long id, char *item);
  extern void freeitem(struct icon_info *item, int s);
--- 31,37 ----
  extern void GetIconBitmap(struct icon_info *item);
  extern void process_message(unsigned long type,unsigned long *body);
  extern void send_clientmessage (Window w, Atom a, Time timestamp);
! extern Bool AddItem(unsigned long id, unsigned long fid, unsigned long flags);
  extern Bool DeleteItem(unsigned long id);
  extern struct icon_info *UpdateItem(unsigned long type, unsigned long id, char *item);
  extern void freeitem(struct icon_info *item, int s);
***************
*** 113,118 ****
--- 112,118 ----
    XWMHints *wmhints;
    int icon_depth;
    long id;
+   long fid;
    long flags;
    struct icon_info *next;
    struct icon_info *prev;
*** icons.c.orig	Mon Jul 25 21:51:53 1994
--- icons.c	Wed Aug  3 11:54:48 1994
***************
*** 48,84 ****
  #define ICON_EVENTS (ExposureMask | StructureNotifyMask|\
  ButtonReleaseMask | ButtonPressMask | EnterWindowMask | LeaveWindowMask)
  
- 
- /****************************************************************************
-  *
-  * Loads an icon file into a pixmap
-  *
-  ****************************************************************************/
- void LoadIconFile(struct icon_info *item)
- {
-   /* monochrome bitmap */
-   if(item->icon_file != NULL)
-     GetBitmapFile(item);
-   
-   /* color pixmap */
-   if((item->icon_file != NULL)&&
-      (item->icon_w == 0)&&(item->icon_h == 0))
-     GetXPMFile(item);
- 
- /* I have no good idea to handle icon windows supplied by apps,
-  *    If you have good idea, please mail to nobuta-s@is.aist-nara.ac.jp
-  *
-  *  if((item->icon_h == 0)&&(item->icon_w == 0)&&
-  *    (item->wmhints) && (item->wmhints->flags & IconWindowHint))
-  *   GetIconWindow(item); 
-  */
- 
-   /* icon bitmap from the application */
-   if((item->icon_h == 0)&&(item->icon_w == 0)&&
-           (item->wmhints)&&(item->wmhints->flags & IconPixmapHint))
-     GetIconBitmap(item);
- }
- 
  /****************************************************************************
   *
   * Creates an Icon Window
--- 48,53 ----
***************
*** 114,128 ****
  
  /****************************************************************************
   *
!  * Combines icon shape masks after a resize
   *
   ****************************************************************************/
  void ConfigureIconWindow(struct icon_info *item, int n)
  {
    Pixmap temp;
!   int hr = ICON_RELIEF/2;
    
!   LoadIconFile(item);
  
  #ifdef XPM
  #ifdef SHAPE
--- 83,127 ----
  
  /****************************************************************************
   *
!  * Loads an icon file and combines icon shape masks after a resize
   *
   ****************************************************************************/
  void ConfigureIconWindow(struct icon_info *item, int n)
  {
    Pixmap temp;
!   unsigned int nchildren;
!   int i, hr = ICON_RELIEF/2;
!   Window Junkroot, Junkparent;
!   Window *wlist;
! 
!   XQueryTree(dpy, Root, &Junkroot, &Junkparent, &wlist, &nchildren);
!   for (i=nchildren-1; i>=0; --i)
!     if (item->fid == wlist[i])
!       item->wmhints = XGetWMHints(dpy, item->id);
!   XFree(wlist);				 
! 
!   if (item->icon_file != NULL && (n != 2 || !(item->wmhints &&
! 					      item->wmhints->flags &
! 					      IconPixmapHint))){  
!     /* monochrome bitmap */
!     GetBitmapFile(item);
    
!     /* color pixmap */
!     if((item->icon_w == 0)&&(item->icon_h == 0))
!       GetXPMFile(item);
!   }
! 
! /* I have no good idea to handle icon windows supplied by apps,
!  *    If you have good idea, please mail to nobuta-s@is.aist-nara.ac.jp
!  *
!  *  if((item->icon_h == 0)&&(item->icon_w == 0)&&
!  *    (item->wmhints) && (item->wmhints->flags & IconWindowHint))
!  *   GetIconWindow(item); 
!  */
!   /* icon bitmap from the application */
!   if((item->icon_h == 0)&&(item->icon_w == 0)&&
!      (item->wmhints)&&(item->wmhints->flags & IconPixmapHint))
!     GetIconBitmap(item);
  
  #ifdef XPM
  #ifdef SHAPE
***************
*** 429,435 ****
        IconwinPixmap = XCreatePixmap(dpy, Root, w, h, d_depth);
        XCopyPlane(dpy, tmp_bitmap, IconwinPixmap, NormalGC, 0, 0, w, h,
  		 0, 0, 1); 
!       XFree(&tmp_bitmap);
      }
      free(path);
    }
--- 428,434 ----
        IconwinPixmap = XCreatePixmap(dpy, Root, w, h, d_depth);
        XCopyPlane(dpy, tmp_bitmap, IconwinPixmap, NormalGC, 0, 0, w, h,
  		 0, 0, 1); 
!       XFreePixmap(dpy, tmp_bitmap);
      }
      free(path);
    }
*** FvwmIconBox.man.orig	Thu Aug  4 10:01:28 1994
--- FvwmIconBox.man	Thu Aug  4 10:06:29 1994
***************
*** 1,6 ****
  .\" t
  .\" @(#)FvwmIconBox.1	6/20/94
! .TH FvwmIconBox 0.5 "Jun 24 1994"
  .UC
  .SH NAME
  FvwmIconBox \- the FVWM iconbox module
--- 1,6 ----
  .\" t
  .\" @(#)FvwmIconBox.1	6/20/94
! .TH FvwmIconBox 0.55 "Jun 24 1994"
  .UC
  .SH NAME
  FvwmIconBox \- the FVWM iconbox module
