On Tuesday 03 December 2002 2:55 pm, Helge Hafting wrote:
> Angus Leeming wrote:
> > ======================= Report ==========================
> > Clicking in the scrollbar trough to scroll through a document
> > auto-repeats after a short delay, as expected. However, the delay before
> > auti-repeating kicks in is too short and the repeat rate much to fast on
> > my system. Most of the time I cannot use clicking in the scrollbar trough
> > to page forward in my documents because the delay before auto-repeating
> > is shorter than my single-click time (and I'm not a slow mouser...)
> > =========================================================
>
> This is fine in 1.2.0
> Holding down the mouse button gives a fast repeating
> page scroll - nice for impressing word users. A
> single click goes one page only, no problem there.
>
> Use the scrollbar up/down buttons for slower scrolling.
>
> Selecting more than a page is a problem though,
> it scrolls just as fast as the scrollbar-repeat-pagedown
> thing which means I can select the entire user guide
> in four seconds.  It is therefore hard to stop the
> selection in an appropriate spot in the middle. :-/
>
> Helge Hafting

It transpires that xforms acts on the first mouse event, discards the next 
ten and thereafter discards every other event when clicking and holding the 
mouse in the scrollbar trough.

This patch to the xforms source seems to cure the problem, acting on every 
10th such mouse event. It's really meant as a diagnostic tool. Presumably the 
real fix is to use a client-side specified timer to discard multiple mouse 
events that occur too closely together.

Incidentally, Lars, this is probably a better appoach than your usleep 
solution to the selection bug. The code should be fixed in XWorkArea.C's 
work_area_handler routine not in screen.C. 

Regards,
Angus
--- slider.c.orig	Thu May 30 17:28:07 2002
+++ slider.c	Tue Dec  3 14:59:21 2002
@@ -293,6 +293,7 @@
 }
 
 static int timdel;
+static int max_timdel = 11;
 static int mpos;		/* < 0 below knob, 0 on knob, > 0 above knob */
 
 /* Handle a mouse position change */
@@ -305,7 +306,7 @@
     /* mouse on trough */
     if (mpos && (sp->rdelta + sp->ldelta) > 0.0f)
     {
-	if (timdel++ == 0 || (timdel > 11 && (timdel & 1) == 0))
+	if (timdel++ == 0)
 	{
 	    if (key == FL_LEFT_MOUSE)
 		newval = sp->val + mpos * sp->ldelta;
@@ -313,7 +314,11 @@
 		newval = sp->val + mpos * sp->rdelta;
 	}
 	else
+	{
+	    if (timdel > max_timdel)
+		timdel = 0;
 	    return 0;
+	}
     }
     else
 	newval = get_newvalue(ob, mx, my);

Reply via email to