scrollbar glitch take 3

Felix Nawothnig felix.nawothnig at t-online.de
Fri May 13 02:57:19 CDT 2005


If the parent of a scrollbar doesn't call SetScrollPos (directly or 
indirectly by ScrollWindow* e.g.) in it's WM_?SCROLL handler (as the 
TScrollBox in WineText.exe from Bug 2764) info->curVal isn't updated 
(right, neither is nVal according to MSDN) which causes 
SCROLL_GetScrollBarRect() to calculate thumbPos based on the old value 
while dragging the thumb.

ChangeLog:
Calculate thumb position based on tracking value while the thumb is moving
-------------- next part --------------
Index: scroll.c
===================================================================
RCS file: /home/wine/wine/dlls/user/scroll.c,v
retrieving revision 1.12
diff -u -r1.12 scroll.c
--- scroll.c	27 Apr 2005 10:23:24 -0000	1.12
+++ scroll.c	13 May 2005 07:46:26 -0000
@@ -280,12 +280,22 @@
         }
         else
         {
+            INT thumbVal;
+
+            /* curVal might still hold the old position while the user drags the thumb */
+            if (SCROLL_MovingThumb &&
+                (SCROLL_TrackingWin == hwnd) &&
+                (SCROLL_TrackingBar == nBar))
+                thumbVal = SCROLL_TrackingVal;
+            else
+                thumbVal = info->curVal;
+
             INT max = info->maxVal - max( info->page-1, 0 );
             if (info->minVal >= max)
                 *thumbPos = *arrowSize - SCROLL_ARROW_THUMB_OVERLAP;
             else
                 *thumbPos = *arrowSize - SCROLL_ARROW_THUMB_OVERLAP
-		  + MulDiv(pixels, (info->curVal-info->minVal),(max - info->minVal));
+		  + MulDiv(pixels, (thumbVal-info->minVal),(max - info->minVal));
         }
     }
     WIN_ReleasePtr( wndPtr );


More information about the wine-patches mailing list