[comp.windows.x] IBM 4.3 RT X11R4 megapel bugs

marc@neon.tcspa.ibm.com (Marc Pawliger) (04/11/90)

This is on the R4 server built with patches to #7.

1) Starting twm with my personal font path crashes the server if
   "ShowIconManager" is in my ~/.twmrc.  I don't have a -g compiled
   server, but dbx at least tells me it's a FPE, a floating underflow,
   in fact.  The font path is done via "xset +fp /usr/lib/X11/fonts/misc,
   /usr/lib/X11/fonts/75dpi,/usr/lib/X11/fonts/100dpi".  There are no
   font specs in my ~/.twmrc.  If I omit the xset, or the ShowIconManager,
   all is well.

2) The Megapel server sometimes doesn't work for andrew toolkit clients.
   Symptoms are: bitblts only being partially done; bit crud left OUTSIDE
   window borders; scrollbars not drawing correctly (seems to be a zero-
   height DrawRect problem).  This is for the ATK compiled against the
   R4 includes and libs.

     --- as always these are my opinions and not those of IBM ---

+--Marc-Pawliger-----------------IBM-AWD--------------------Palo-Alto--+
|   Internet: marc%ibmsupt@uunet.uu.net    VNET:   MARC at PALOALTO    |
|    UUCP:      uunet!ibmsupt!ibmpa!marc    Phonenet: (415) 855-3493   |
+-----IBMnet:----marc@ibmpa.tcspa.ibm.com----IBM-Tie-Line:---465-3493--+

jfc@ATHENA.MIT.EDU (John Carr) (04/12/90)

I wasn't able to reproduce the problem with the server crashing.  Either
it's fixed in the server I'm running, or I'm missing the right lines from
.twmrc (I don't normally use twm, so I copied system.twmrc and added the
line "ShowIconManager").  A stack trace, even without full debugging
symbols, would be helpful.

I've found a fix for the problems with Andrew (they are in the IBM ppc code,
and should apply to any of the IBM color servers).  The problems are:

	1. Clip calculations on clients with multiple windows sharing
	   a GC (and possibly in other cases) are wrong.

	2. Rectangles smaller than line width are drawn incorrectly
	   (no check for (height - lineWidth / 2) negative).

*** /tmp/,RCSt1001812	Thu Apr 12 02:45:45 1990
--- ppcGC.c	Thu Apr 12 02:45:46 1990
***************
*** 273,278 ****
--- 273,279 ----
      ppcScrnPriv *devScrnPriv = pGC->pScreen->devPrivate ;
      WindowPtr pWin ;
      Mask bsChanges = 0 ;
+     int oldx, oldy;
  
      devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
  
***************
*** 286,301 ****
  	ibmAbort();
      }
  
!     if ( pDrawable->type == DRAWABLE_WINDOW ) {
! 	pWin = (WindowPtr) pDrawable ;
! 	pGC->lastWinOrg.x = pWin->drawable.x ;
! 	pGC->lastWinOrg.y = pWin->drawable.y ;
!     }
!     else {
! 	pWin = (WindowPtr) NULL ;
! 	pGC->lastWinOrg.x = 0 ;
! 	pGC->lastWinOrg.y = 0 ;
!     }
  
      changes &= ppcGCInterestValidateMask ;
      /* If Nothing REALLY Changed, Just Return */
--- 287,297 ----
  	ibmAbort();
      }
  
!     pWin = (pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr) pDrawable : (WindowPtr) NULL;
!     oldx = pGC->lastWinOrg.x;
!     oldy = pGC->lastWinOrg.y;
!     pGC->lastWinOrg.x = pDrawable->x;
!     pGC->lastWinOrg.y = pDrawable->y;
  
      changes &= ppcGCInterestValidateMask ;
      /* If Nothing REALLY Changed, Just Return */
***************
*** 318,327 ****
  		the window has moved
  	   we need to (re)translate it.
  	*/
! 	if ( ( pGC->clientClipType == CT_REGION )
! 	  && ( ( changes & ( GCClipXOrigin | GCClipYOrigin | GCClipMask ) )
! 	    || ( ( pGC->lastWinOrg.x != pGC->lastWinOrg.x )
! 	      || ( pGC->lastWinOrg.y != pGC->lastWinOrg.y ) ) ) ) {
  	    /* retranslate client clip */
  
  	    (* pGC->pScreen->TranslateRegion)(
--- 314,323 ----
  		the window has moved
  	   we need to (re)translate it.
  	*/
! 	if ((pGC->clientClipType == CT_REGION) &&
! 	    ((changes & (GCClipXOrigin | GCClipYOrigin | GCClipMask)) ||
! 	     ((pGC->lastWinOrg.x != oldx) ||
! 	      (pGC->lastWinOrg.y != oldy)))) {
  	    /* retranslate client clip */
  
  	    (* pGC->pScreen->TranslateRegion)(

*** /tmp/,RCSt1001837	Thu Apr 12 02:47:59 1990
--- ppcPolyRec.c	Thu Apr 12 02:48:00 1990
***************
*** 71,76 ****
--- 71,82 ----
  
      for (i=0; i<nrects; i++)
      {
+ 	int tmp;
+ 
+ 	/* Two step calculation because height is unsigned */
+ 	tmp = pR->height;
+ 	tmp = (tmp - lw > 0) ? (tmp - lw) : 0;
+ 
  	tmprects->x = pR->x - ss;
  	tmprects->y = pR->y - ss;
  	tmprects->width = pR->width + lw;
***************
*** 80,92 ****
  	tmprects->x = pR->x - ss;
  	tmprects->y = pR->y + fs;
  	tmprects->width = lw;
! 	tmprects->height = pR->height - lw;
  	tmprects++;
  
  	tmprects->x = pR->x + pR->width - ss;
  	tmprects->y = pR->y + fs;
  	tmprects->width = lw;
! 	tmprects->height = pR->height - lw;
  	tmprects++;
  
  	tmprects->x = pR->x - ss;
--- 86,98 ----
  	tmprects->x = pR->x - ss;
  	tmprects->y = pR->y + fs;
  	tmprects->width = lw;
! 	tmprects->height = tmp;
  	tmprects++;
  
  	tmprects->x = pR->x + pR->width - ss;
  	tmprects->y = pR->y + fs;
  	tmprects->width = lw;
! 	tmprects->height = tmp;
  	tmprects++;
  
  	tmprects->x = pR->x - ss;


    --John Carr (jfc@athena.mit.edu)