Subject: Re: FVWM: fvwm Scroll Resistance Timer Patch

From: "Richard A. Guay" <[email-masked]>
Date: Thu, 18 Jul 1996 08:33:07 -0400

Hi,

I believe that my problem is the same as for this patch, except a whole
lot worse.  There are times that all my windows freeze with everything 
blank when my mouse is near the screen edges.  I also have the problem
that EdgeResistance sometimes does not work but switches screens
when the mouse is just getting to the edge, but then not redrawing the
screen for a long wait.

The question I have is, how to you apply this patch?  I have a Sun OS 
4.1.3 system.  I have never delt with patches before.

----------
> From: Mike Blatchley <[email-masked]>
> To: Charles Hines <[email-masked]>
> Cc: fvwm <[email-masked]>
> Subject: FVWM: fvwm Scroll Resistance Timer Patch
> Date: Wednesday, July 17, 1996 8:47 PM
> 
> Chuck,
> 
> Since the early days of fvwm-2, I have seen a problem when using a 
> large value for the EdgeResistance timer such as:
> 
>    EdgeResistance 1000 50
>    EdgeScroll 100 100
> 
> The 1000 says the pointer must be left at the screen edge for 1second 
> before moving the viewport to a different page.  If the pointer is 
> _retracted_ within this time period, life is supposed to go on 
> uninterrupted.  Normally, it does.
> 
> However, if a window is being moved or resized when the pointer hits the 
> edge, life does not go on _if the pointer is retracted within this time_ 
> period.  Everything is temporarily put on hold for, say, 1second.  If it 
> enters and exits the pan frame region multiple times before the mouse 
> button is released, things can be put on hold for even longer!
> 
> The problem is the Pan Frames are "covered" by the window being 
> moved/resized, so the "LeaveWindowMask" event is never seen and we get 
> trapped inside of the sleep loop for the entire duration.  The patch 
> below fixes this.  It also eliminates the window from lagging behind the 
> pointer at the moment you hit the screen edge during a move/resize (a 
> little aesthetic fix-up).
> 
> I submitted a patch for this a while back, but it seems to have never 
> made its way into fvwm.  Here's a cleaner patch to fvwm-2.0.43.
> 
> 
> Thanks,
> 
> Mike Blatchley
> ======================================================================
>                          * Mike Blatchley * 
>                 * email: [email-masked] *
>               * MIME Mail Reader * PGP Key Available *
> ======================================================================
> 
> 
> File: fvwm-2.0.43-mab.p1
> (be careful that the mail reader does not wrap any of the longer lines)
> ------------------------------ cut here ---------------------------
> --- fvwm-2.0.43/fvwm/move.c	Fri Jun 30 09:06:01 1995
> +++ fvwm-2.0.43.patched/fvwm/move.c	Sun Jul 14 18:38:49 1996
> @@ -111,7 +111,7 @@
>  {
>    Bool finished = False;
>    Bool done;
> -  int xl,yt,delta_x,delta_y;
> +  int xl,yt,delta_x,delta_y,paged;
>  
>    XQueryPointer(dpy, Scr.Root, &JunkRoot, &JunkChild,&xl, &yt,
>  		&JunkX, &JunkY, &JunkMask);
> @@ -202,8 +202,8 @@
>  	case MotionNotify:
>  	  xl = Event.xmotion.x_root;
>  	  yt = Event.xmotion.y_root;
> -	  HandlePaging(Scr.MyDisplayWidth,Scr.MyDisplayHeight,&xl,&yt,
> -		       &delta_x,&delta_y,False);
> +/*	  HandlePaging(Scr.MyDisplayWidth,Scr.MyDisplayHeight,&xl,&yt,
> +		       &delta_x,&delta_y,False);  mab */
>  	  /* redraw the rubberband */
>  	  xl += XOffset;
>  	  yt += YOffset;
> @@ -220,6 +220,11 @@
>  	  if((yt <= 0)&&(yt > -Scr.MoveResistance))
>  	    yt = 0;
>  
> +	/* check Paging request once and only once after outline redrawn */
> +	/* redraw after paging if needed - mab */
> +	paged=0;
> +	while(paged<=1)
> +	 {
>  	  if(!opaque_move)
>  	    MoveOutline(Scr.Root, xl, yt, Width,Height);
>  	  else
> @@ -242,6 +247,21 @@
>  		XMoveWindow(dpy,tmp_win->frame,xl,yt);
>  	    }
>  	  DisplayPosition(tmp_win,xl+Scr.Vx,yt+Scr.Vy,False);
> +
> +/* prevent window from lagging behind mouse when paging - mab */
> +	  if(paged==0)
> +	    {
> +	    xl = Event.xmotion.x_root;
> +	    yt = Event.xmotion.y_root;
> +	    HandlePaging(Scr.MyDisplayWidth,Scr.MyDisplayHeight,&xl,&yt,
> +		       &delta_x,&delta_y,False);
> +	    xl += XOffset;
> +	    yt += YOffset;
> +	    if ( (delta_x==0) && (delta_y==0)) break; /* break from while paged
*/
> +	    }
> +	  paged++;
> +	 }  /* end while paged */
> +
>  	  done = TRUE;
>  	  break;
>  
> --- fvwm-2.0.43/fvwm/resize.c	Fri Jun 30 09:07:23 1995
> +++ fvwm-2.0.43.patched/fvwm/resize.c	Sun Jul 14 19:30:07 1996
> @@ -214,15 +214,21 @@
>  	case MotionNotify:
>  	  x = Event.xmotion.x_root;
>  	  y = Event.xmotion.y_root;
> +	  /* resize before paging request to prevent resize from lagging mouse
- mab */
> +	  DoResize(x, y, tmp_win);  
>  	  /* need to move the viewport */
>  	  HandlePaging(Scr.EdgeScrollX,Scr.EdgeScrollY,&x,&y,
>  		       &delta_x,&delta_y,False);
> +	/* redraw outline if we paged - mab */
> +	if ( (delta_x != 0) || (delta_y != 0) )
> +	  {
>  	  origx -= delta_x;
>  	  origy -= delta_y;
>  	  dragx -= delta_x;
>  	  dragy -= delta_y;
>  
>  	  DoResize(x, y, tmp_win);
> +	  }
>  	  done = TRUE;
>  	default:
>  	  break;
> --- fvwm-2.0.43/fvwm/virtual.c	Wed Apr 24 09:45:27 1996
> +++ fvwm-2.0.43.patched/fvwm/virtual.c	Sun Jul 14 00:36:24 1996
> @@ -42,6 +42,10 @@
>      {
>        sleep_a_little(10000);
>        total+=10;
> +
> +  XQueryPointer(dpy, Scr.Root, &JunkRoot, &JunkChild,
> +		&x, &y, &JunkX, &JunkY, &JunkMask); 
> +
>        if(XCheckWindowEvent(dpy,Scr.PanFrameTop.win,
>  			   LeaveWindowMask,&Event))
>  	{
> @@ -66,6 +70,11 @@
>  	  StashEventTime(&Event);
>  	  return;
>  	}
> +      /* check actual pointer location since PanFrames can get buried
under
> +         a window being moved or resized - mab */
> +      if(( x >= SCROLL_REGION )&&( x < Scr.MyDisplayWidth-SCROLL_REGION
)&&
> +         ( y >= SCROLL_REGION )&&( y < Scr.MyDisplayHeight-SCROLL_REGION
))
> +           return ;
>      }
>    
>    XQueryPointer(dpy, Scr.Root, &JunkRoot, &JunkChild,
> ------------------------------ cut here
------------------------------------
> 
> --
> 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].
> 
--
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].

---

From: "Charles Hines" <[email-masked]>
Date: Thu, 18 Jul 1996 08:55:17 -0400

>>>>> "Mike" == Mike Blatchley <[email-masked]> writes:
>>>>> "Richard" == Richard A Guay <[email-masked]> writes:

Mike> Chuck,

Mike> Since the early days of fvwm-2, I have seen a problem when using a
Mike> large value for the EdgeResistance timer such as:
....
Mike> However, if a window is being moved or resized when the pointer hits the
Mike> edge, life does not go on _if the pointer is retracted within this time_
Mike> period.  Everything is temporarily put on hold for, say, 1second.  If it
Mike> enters and exits the pan frame region multiple times before the mouse
Mike> button is released, things can be put on hold for even longer!
....
Mike> I submitted a patch for this a while back, but it seems to have never
Mike> made its way into fvwm.  Here's a cleaner patch to fvwm-2.0.43.

Yeah, it must have slipped through the proverbial cracks, as things
often do...

I'll play with it and if things look ok with it, it'll be in 2.1.0.

Richard> I believe that my problem is the same as for this patch,
Richard> except a whole lot worse.  There are times that all my
Richard> windows freeze with everything blank when my mouse is near
Richard> the screen edges.  I also have the problem that
Richard> EdgeResistance sometimes does not work but switches screens
Richard> when the mouse is just getting to the edge, but then not
Richard> redrawing the screen for a long wait.

Your problem may be related to that patch, but may also be partly
caused by an overworked system.  I know if something is churning away
on my machine, I'll see long delays in switching pages with symptoms
like what you describe.

Richard> The question I have is, how to you apply this patch?  I have
Richard> a Sun OS 4.1.3 system.  I have never delt with patches
Richard> before.

See the FAQ, question #24:

----------------------------------------------------------------------

24) How do I create/submit/apply patches?

A: Creating a patch -

        1) Copy the originial source file(s) to the same name with the
           additional extension of .orig (or something like that).
        2) Then run diff with either the -c (context) or -u (unified)
           switch on the sets of files, with the .orig file FIRST.  I
           prefer unifified diff's because they are smaller, but
           sometimes they aren't as readable, so either context or
           unified diffs are fine.

        ex: cp fvwm.c fvwm.c.orig ; diff -u fvwm.c.orig fvwm.c

   Submitting a patch -

        Just mail it to the fvwm mailing list, is the best way I
        guess.

   Applying a patch -

        Get a copy of the program 'patch' from your favorite source,
        such as prep.ai.mit.edu in /pub/gnu, compile it, and then
        follow it's directions (generally just cd into the appropriate
        directory and run 'patch < patchfile').

----------------------------------------------------------------------

Chuck