Subject: Bug fixes for 2.0.47d FvwmWinList.

From: Rocky - Rakesh Patel <[email-masked]>
Date: Thu, 9 Jul 1998 00:03:55 -0400 (EDT)

The previous patches I sent for fixing FvwmWinList were inadequate. I ended up
re-writing the code after discovering the mechanism used to check on the
x,y co-ordinates of the FvwmWinList window was unreliable. Serious stress
tests were done this time and the code is very straightforward this time.

I'm including the patches for bug fixes only in this message.  Separately will
be the patch with the sort option for FvwmWinList.  The patches are relative
to the FvwmWinList directory (modules/FvwmWinList).

Rocky.

Here they are:

*** ButtonArray.c.ORIG	Mon Sep 23 20:04:56 1996
--- ButtonArray.c	Tue Jul  7 19:17:58 1998
***************
*** 337,343 ****
      }
  	else
  	{
! 		newx = 4;
  	}
  
    string=button->title;
--- 337,346 ----
      }
  	else
  	{
! 	  if (LeftJustify)
! 	      newx = 4;
! 	  else
! 	      newx=max((w-button->tw)/2,4);
  	}
  
    string=button->title;
*** FvwmWinList.c.ORIG	Thu Jul  2 13:14:04 1998
--- FvwmWinList.c	Wed Jul  8 22:49:19 1998
***************
*** 718,757 ****
    {
      if (Anchor)
      {
!       if (win_grav==SouthEastGravity || win_grav==NorthEastGravity)
!         win_x-=(new_width-win_width);
  
!       if (win_grav==SouthEastGravity || win_grav==SouthWestGravity)
!         win_y-=(new_height-win_height);
! 
! #if 0
!       if(RESIZE_BUG_HACK)
        {
!         if (win_grav==SouthEastGravity || win_grav==NorthEastGravity)
! 		win_x+= win_border - 2;
! 	else
! 		win_x-=win_border;
! 
! 	if (win_grav==SouthEastGravity || win_grav==SouthWestGravity)
! 		win_y+=win_border - 2;
! 	else	
! 		win_y-=win_border;
!       }
! #else /* ckh - need to come up w/ better way to calculate win_x & _y */
!         if (win_grav==SouthEastGravity || win_grav==NorthEastGravity)
! 		win_x+= win_border-3;
! 	else
! 		win_x-=win_border;
! 
! 	if (win_grav==SouthEastGravity || win_grav==SouthWestGravity)
! 		win_y+=win_border-3;
! 	else	
! 		win_y-=win_border;
! #endif /* 0 */
  
!       XMoveResizeWindow(dpy,win,win_x+win_border,win_y+win_title+win_border,
!         new_width,new_height);
  
      }
      else
        XResizeWindow(dpy, win, new_width,new_height);
--- 718,763 ----
    {
      if (Anchor)
      {
!       static int x1, x2, y1 , y2;
!       int new_x, new_y;
!       static int gothints = 0;
!       XSizeHints hints;
  
!       if ( !gothints )
        {
!         XGetNormalHints(dpy,win,&hints);
! 
!         x1 = (hints.x < 0 ? 0 : hints.x);
!         x2 = ScreenWidth - x1 - hints.width;
!         if ( x2 < 0 ) x2 = 0;
  
!         y1 = (hints.y < 0 ? 0 : hints.y);
!         y2 = ScreenHeight - y1 - hints.height;
!         if( y2 < 0 ) y2 = 0;
! 
!         gothints = 1;
!       }
  
+       if ( win_grav == NorthEastGravity || win_grav == SouthEastGravity)
+         new_x = ScreenWidth - x2 - win_border*2 - new_width;
+       else
+         new_x = x1;
+ 
+       if ( win_grav == SouthEastGravity || win_grav == SouthWestGravity)
+         new_y = ScreenHeight - y2 - win_border*2 - new_height;
+       else
+         new_y = y1;
+   
+       if ( win_border > 0 )
+       {
+         new_x += win_border+1;
+         new_y += win_border+1;
+       }
+       if ( win_title > 0)
+       {
+         new_y += win_title+1;
+       }
+       XMoveResizeWindow(dpy,win,new_x, new_y, new_width,new_height);
      }
      else
        XResizeWindow(dpy, win, new_width,new_height);

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