[comp.sources.bugs] Official patch #11 for faces v1.3; please apply it.

richb@sunchat.oz (Rich Burridge) (02/27/89)

It fixes the following problems:

1/ Bug report and fix from Dave Cohrs (sun!cs.wisc.edu!dave)
   When creating the X11 window, the code specifies an IconPixmapHint,
   but never fills in the value.

2/ Suggested fix from Perry Metzger (perry%snark.bellcore.com)
   The character cursor can be "undisplayed" from the MGR version, when
   the faces window becomes activated, by specifying a position offscreen.

3/ The default version of faces made by the Makefile, is the SunView
   version under SunOS v4.0. The three MGR definitions should therefore
   be commented out.

4/ Bug report and fix by C. P. Lai (sun!pyramid!daisy.sun.com!cplai)
   With the new -e monitoring option, end of file should also be
   checked for, not equality to zero.

5/ Bug report by C. P. Lai (sun!pyramid!daisy.sun.com!cplai)
   With the new -e monitoring option, no matter what dimensions you
   specified for the size of the window and icon, you ended up with
   one which was ten columns by one row.

6/ Bug report by C. P. Lai (sun!pyramid!daisy.sun.com!cplai) 
   With the new -e monitoring option, the second and subsequents
   iterations of the user defined program or shell script, were
   placing the icons in the wrong position.

That's about it for faces until the next release much later in the year.
This will include versions for the View2 and NDE toolkits.

I've had several other suggestions been sent to me, and I will definitely
consider them for this next release. These include:

   a) Arbitary sized icons, which is currently not a simple modification.
   b) UK style domain name munging. If anybody wants to send me code to
      do this, then I'll add it in now.
   c) identification of multiple printers by showing the printer name.
   d) Using the system provided procedure for reading X bitmaps. If
      somebody would like to tell me what that is, I'll consider it now.

I welcome further bug reports, and will endevour to fix them where possible.

Feed this file to Larry Walls' patch program, then recompile.

    Rich.

------CUT HERE------CUT HERE------
*** original/Makefile	Sat Feb 18 22:02:23 1989
--- Makefile	Sun Feb 26 19:19:05 1989
***************
*** 1,7 ****
  #
  #  Makefile for faces, an icon face server, plus associated software.
  #
! #  @(#)Makefile 1.7 89/02/18
  #
  #  Copyright (c) Rich Burridge.
  #                Sun Microsystems, Australia - All rights reserved.
--- 1,7 ----
  #
  #  Makefile for faces, an icon face server, plus associated software.
  #
! #  @(#)Makefile 1.8 89/02/26
  #
  #  Copyright (c) Rich Burridge.
  #                Sun Microsystems, Australia - All rights reserved.
***************
*** 91,99 ****
  #  If you are compiling the MGR version, then the following three
  #  definitions should be uncommented.
  #
! MGRHOME         = /usr/mgr
! MGRPARAM        = -DMGRHOME=\"$(MGRHOME)\"
! MGRINCDIR       = -I$(MGRHOME)/include
  #-------------------------------------------------------------------
  
  VARIABLES       = $(FMONTYPE) $(BACKGROUND) $(FACEPARAM) \
--- 91,99 ----
  #  If you are compiling the MGR version, then the following three
  #  definitions should be uncommented.
  #
! #MGRHOME         = /usr/mgr
! #MGRPARAM        = -DMGRHOME=\"$(MGRHOME)\"
! #MGRINCDIR       = -I$(MGRHOME)/include
  #-------------------------------------------------------------------
  
  VARIABLES       = $(FMONTYPE) $(BACKGROUND) $(FACEPARAM) \
*** original/extern.h	Wed Feb 22 15:21:13 1989
--- extern.h	Sun Feb 26 19:19:04 1989
***************
*** 1,5 ****
  
! /*  @(#)extern.h 1.7 89/02/22
   *
   *  Contains the external variable definitions used by faces.
   *
--- 1,5 ----
  
! /*  @(#)extern.h 1.8 89/02/26
   *
   *  Contains the external variable definitions used by faces.
   *
***************
*** 64,69 ****
--- 64,70 ----
  extern int invert ;        /* Set if to use reverse video. */
  extern int ix ;            /* Initial X position of the icon. */
  extern int iy ;            /* Initial Y position of the icon. */
+ extern int maxcols ;       /* Maximum number of columns to display. */
  extern int maxtypes ;      /* Max. no. of icon types for graphics target. */
  extern int mhflag ;        /* Set if this user uses MH to read mail. */
  extern int newmail ;       /* Set if there is new mail this time around. */
*** original/main.c	Wed Feb 22 15:21:12 1989
--- main.c	Sun Feb 26 19:19:01 1989
***************
*** 1,5 ****
  #ifndef lint
! static char sccsid[] = "@(#)main.c 1.8 89/02/22" ;
  #endif
  
  /*  Icon face server for monitoring mail and print jobs.
--- 1,5 ----
  #ifndef lint
! static char sccsid[] = "@(#)main.c 1.9 89/02/26" ;
  #endif
  
  /*  Icon face server for monitoring mail and print jobs.
***************
*** 69,74 ****
--- 69,75 ----
  int invert ;        /* Set if to use reverse video. */
  int ix ;            /* Initial X position of the icon. */
  int iy ;            /* Initial Y position of the icon. */
+ int maxcols ;       /* Maximum number of columns to display. */
  int maxtypes ;      /* Maximum number of icon types for graphics target. */
  int mhflag ;        /* Set if this user uses MH to read mail. */
  int newmail ;       /* Set if there is new mail this time around. */
***************
*** 172,177 ****
--- 173,179 ----
    lastsize = 0 ;              /* Initial size of spoolfile. */
    firsttime = 1 ;             /* No checks made yet. */
    iconic = 0 ;                /* Initially an open window. */
+   maxcols = NO_PER_ROW ;      /* Initialise maximum number of columns. */
    mhflag = 0 ;                /* Assume no MH mail by default. */
    posspec = 0 ;               /* Assume no -Wp or -g by default. */
    wx = wy = ix = iy = 0 ;
*** original/mgr.c	Wed Feb 22 15:21:25 1989
--- mgr.c	Sun Feb 26 19:19:08 1989
***************
*** 1,6 ****
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)mgr.c 1.3 89/02/22" ;
  #endif
  
  /*  MGR dependent graphics routines used by faces,
--- 1,6 ----
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)mgr.c 1.4 89/02/26" ;
  #endif
  
  /*  MGR dependent graphics routines used by faces,
***************
*** 325,330 ****
--- 325,331 ----
        m_shapewindow(x, y, width+10, height+10) ;
        m_bitcopyto(0, 0, width, height, 0, 0, 0, PR) ;
      }
+   m_movecursor(2500, 2500) ;    /* Move cursor totally offscreen. */
  }
  
  
*** original/mon.c	Wed Feb 22 15:21:12 1989
--- mon.c	Sun Feb 26 19:19:03 1989
***************
*** 1,6 ****
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)mon.c 1.9 89/02/22" ;
  #endif
  
  /*  Monitoring routines used by the faces program.
--- 1,6 ----
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)mon.c 1.10 89/02/26" ;
  #endif
  
  /*  Monitoring routines used by the faces program.
***************
*** 25,31 ****
  
    if (mtype != MONNEW)
      {
!       if (++column == NO_PER_ROW)
          {
            column = 0 ;
            row++ ;
--- 25,31 ----
  
    if (mtype != MONNEW)
      {
!       if (++column == maxcols)
          {
            column = 0 ;
            row++ ;
***************
*** 253,273 ****
    if (cols < 1) cols = 10 ;
    if (rows < 1) rows = 1 ;
  
!   create_pixrects(cols * ICONWIDTH, rows * ICONHEIGHT) ;
    while (fgets(nextline, MAXLINE, fp) != NULL)
      {
        nextline[80] = '\0' ;
!       if (!sscanf(&nextline[70], "%s", iright)) iright[0] = '\0' ;
        nextline[70] = '\0' ;
!       if (!sscanf(&nextline[60], "%s", ileft)) ileft[0] = '\0' ;
        nextline[60] = '\0' ;
!       if (!sscanf(&nextline[50], "%s", wright)) wright[0] = '\0' ;
        nextline[50] = '\0' ;
!       if (!sscanf(&nextline[40], "%s", wleft)) wleft[0] = '\0' ;
        nextline[40] = '\0' ;
!       if (!sscanf(&nextline[20], "%s", host)) host[0] = '\0' ;
        nextline[20] = '\0' ;
!       if (!sscanf(&nextline[0], "%s", user)) user[0] = '\0' ;
  
        STRCPY(community, "") ;
        if (!(EQUAL(user, "NOMAIL")  || EQUAL(user, "NOPAPER") ||
--- 253,278 ----
    if (cols < 1) cols = 10 ;
    if (rows < 1) rows = 1 ;
  
!   width = cols * ICONWIDTH ;
!   height = rows * ICONHEIGHT ;
!   create_pixrects(width, height) ;
! 
!   maxcols = cols ;          /* Maximum width in columns. */
!   column = row = 0 ;        /* Start in top left corner of pixrect. */
    while (fgets(nextline, MAXLINE, fp) != NULL)
      {
        nextline[80] = '\0' ;
!       if (sscanf(&nextline[70], "%s", iright) == EOF) iright[0] = '\0' ;
        nextline[70] = '\0' ;
!       if (sscanf(&nextline[60], "%s", ileft) == EOF) ileft[0] = '\0' ;
        nextline[60] = '\0' ;
!       if (sscanf(&nextline[50], "%s", wright) == EOF) wright[0] = '\0' ;
        nextline[50] = '\0' ;
!       if (sscanf(&nextline[40], "%s", wleft) == EOF) wleft[0] = '\0' ;
        nextline[40] = '\0' ;
!       if (sscanf(&nextline[20], "%s", host) == EOF) host[0] = '\0' ;
        nextline[20] = '\0' ;
!       if (sscanf(&nextline[0], "%s", user) == EOF) user[0] = '\0' ;
  
        STRCPY(community, "") ;
        if (!(EQUAL(user, "NOMAIL")  || EQUAL(user, "NOPAPER") ||
*** original/patchlevel.h	Wed Feb 22 15:21:25 1989
--- patchlevel.h	Sun Feb 26 19:19:04 1989
***************
*** 1,5 ****
   
! /*  @(#)patchlevel.h 1.11 89/02/22
   *
   *  This is the current patch level for this version of faces.
   *
--- 1,5 ----
   
! /*  @(#)patchlevel.h 1.12 89/02/26
   *
   *  This is the current patch level for this version of faces.
   *
***************
*** 14,17 ****
   *  reported to me then an attempt will be made to fix them.
   */
  
! #define  PATCHLEVEL  10
--- 14,17 ----
   *  reported to me then an attempt will be made to fix them.
   */
  
! #define  PATCHLEVEL  11
*** original/x11.c	Wed Feb 22 15:21:25 1989
--- x11.c	Sun Feb 26 19:19:06 1989
***************
*** 1,6 ****
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)x11.c 1.6 89/02/22" ;
  #endif
  
  /*  X11 dependent graphics routines used by faces,
--- 1,6 ----
  /*LINTLIBRARY*/
  #ifndef lint
! static char sccsid[] = "@(#)x11.c 1.7 89/02/26" ;
  #endif
  
  /*  X11 dependent graphics routines used by faces,
***************
*** 332,338 ****
  
    wm_hints.icon_x = ix ;
    wm_hints.icon_y = iy ;
!   wm_hints.flags = IconPositionHint | IconPixmapHint | IconWindowHint ;
    wm_hints.icon_window = frame_icon ;
    if (iconic)
      {
--- 332,338 ----
  
    wm_hints.icon_x = ix ;
    wm_hints.icon_y = iy ;
!   wm_hints.flags = IconPositionHint | IconWindowHint ;
    wm_hints.icon_window = frame_icon ;
    if (iconic)
      {