Subject: FVWM: Small changes to EdgeScroll and Paging

From: Henrique Martins <[email-masked]>
Date: Fri, 15 Mar 1996 17:23:50 -0800

- The reintroduction of the EdgeScroll x1000 effect, for a cylindrical or
  spherical desktop, misbehaves when one of the desktop dimensions is 1,
  i.e. either a Nx1 or 1xN DeskTopSize. Try moving against one the edges of
  the desktop along that single dimension, and the window will jump to the
  other side, but the cursor gets stuck on the edge.

  - When EdgeScrollX and/or Y are not 100%, i.e. a full page, moving a
  window against one of the edges still pages a full page.

  The diffs below fix the two problems above, (if indeed the second is a
  problem.) It also eliminates a bunch of what I think is redundant code
  from virtual.c, that had to do with implementing the x1000 edge scrolling.
  
  -- Henrique

*** move.c.orig Mon Feb 26 19:59:18 1996
--- move.c      Fri Mar 15 15:08:10 1996
***************
*** 202,208 ****
        case MotionNotify:
          xl = Event.xmotion.x_root;
          yt = Event.xmotion.y_root;
!         HandlePaging(Scr.MyDisplayWidth,Scr.MyDisplayHeight,&xl,&yt,
                       &delta_x,&delta_y,False);
          /* redraw the rubberband */
          xl += XOffset;
--- 202,208 ----
        case MotionNotify:
          xl = Event.xmotion.x_root;
          yt = Event.xmotion.y_root;
!         HandlePaging(Scr.EdgeScrollX,Scr.EdgeScrollY,&xl,&yt,
                       &delta_x,&delta_y,False);
          /* redraw the rubberband */
          xl += XOffset;
*** virtual.c.orig	Fri Mar 15 15:56:18 1996
--- virtual.c	Fri Mar 15 16:10:44 1996
***************
*** 31,40 ****
      return;
    
    /* need to move the viewport */
!   if(( *xl >= SCROLL_REGION)&&( *xl < Scr.MyDisplayWidth-SCROLL_REGION)&&
!      ( *yt >= SCROLL_REGION)&&( *yt < Scr.MyDisplayHeight-SCROLL_REGION))
      return;
!   
    total = 0;
    while(total < Scr.ScrollResistance)
      {
--- 31,42 ----
      return;
    
    /* need to move the viewport */
!   if(( Scr.VxMax == 0 ||
!        (*xl >= SCROLL_REGION && *xl < Scr.MyDisplayWidth  - SCROLL_REGION)) &&
!      ( Scr.VyMax == 0 ||
!        (*yt >= SCROLL_REGION && *yt < Scr.MyDisplayHeight - SCROLL_REGION)))
      return;
! 
    total = 0;
    while(total < Scr.ScrollResistance)
      {
***************
*** 82,87 ****
--- 84,90 ----
      *delta_x = HorWarpSize;
    else
      *delta_x = 0;
+   if (Scr.VxMax == 0) *delta_x = 0;
    if( y<SCROLL_REGION)
      *delta_y = -VertWarpSize;
    else if ( y >= Scr.MyDisplayHeight-SCROLL_REGION)
***************
*** 88,120 ****
      *delta_y = VertWarpSize;
    else
      *delta_y = 0;
    
    /* Ouch! lots of bounds checking */
    if(Scr.Vx + *delta_x < 0) 
      {
!       if (!(Scr.flags & EdgeWrapX ))
  	{
! 	  *delta_x = -Scr.Vx;
! 	  *xl = x - *delta_x;
  	}
-       else 
- 	{
- 	  *delta_x += Scr.VxMax + Scr.MyDisplayWidth;
- 	  *xl = x + *delta_x % Scr.MyDisplayWidth + HorWarpSize;
- 	}
      }
    else if(Scr.Vx + *delta_x > Scr.VxMax)
      {
!       if (!(Scr.flags & EdgeWrapX))
  	{
! 	  *delta_x = Scr.VxMax - Scr.Vx;
! 	  *xl = x - *delta_x;
  	}
-       else 
- 	{
- 	  *delta_x -= Scr.VxMax +Scr.MyDisplayWidth;
- 	  *xl = x + *delta_x % Scr.MyDisplayWidth - HorWarpSize;
- 	}
      }
    else
      *xl = x - *delta_x;
--- 91,114 ----
      *delta_y = VertWarpSize;
    else
      *delta_y = 0;
+   if (Scr.VyMax == 0) *delta_y = 0;
    
    /* Ouch! lots of bounds checking */
    if(Scr.Vx + *delta_x < 0) 
      {
!       if (Scr.flags & EdgeWrapX)
  	{
! 	  *delta_x = Scr.VxMax;
! 	  *xl = x + Scr.MyDisplayWidth;
  	}
      }
    else if(Scr.Vx + *delta_x > Scr.VxMax)
      {
!       if (Scr.flags & EdgeWrapX)
  	{
! 	  *delta_x = -Scr.VxMax;
! 	  *xl = x - Scr.MyDisplayWidth;
  	}
      }
    else
      *xl = x - *delta_x;
***************
*** 121,148 ****
    
    if(Scr.Vy + *delta_y < 0) 
      {
!       if (!(Scr.flags & EdgeWrapY))
  	{
! 	  *delta_y = -Scr.Vy;
! 	  *yt = y - *delta_y;
  	}
-       else
- 	{
- 	  *delta_y += Scr.VyMax + Scr.MyDisplayHeight;
- 	  *yt = y + *delta_y % Scr.MyDisplayHeight + VertWarpSize;
- 	}
      }
    else if(Scr.Vy + *delta_y > Scr.VyMax) 
      {
!       if (!(Scr.flags & EdgeWrapY))
  	{
! 	  *delta_y = Scr.VyMax - Scr.Vy;
! 	  *yt = y - *delta_y;
! 	}
!       else
! 	{
! 	  *delta_y -= Scr.VyMax + Scr.MyDisplayHeight;
! 	  *yt = y + *delta_y % Scr.MyDisplayHeight - VertWarpSize;
  	}
      }
    else
--- 115,132 ----
    
    if(Scr.Vy + *delta_y < 0) 
      {
!       if (Scr.flags & EdgeWrapY)
  	{
! 	  *delta_y = Scr.VyMax;
! 	  *yt = y + Scr.MyDisplayHeight;
  	}
      }
    else if(Scr.Vy + *delta_y > Scr.VyMax) 
      {
!       if (Scr.flags & EdgeWrapY)
  	{
! 	  *delta_y = -Scr.VyMax;
! 	  *yt = y - Scr.MyDisplayHeight;
  	}
      }
    else
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].