[PROBLEM REPORT] Edit control line scrolling

Gerard Patel gerard.patel at nerim.net
Mon Jul 23 17:31:08 CDT 2001


With programs using a multiline edit control, such as Notepad (I'm using Win3.11
version) or Eudora Light 1.5 with mails from the 'In' mailbox (this is a 32 bits
application), scrolling down the edit buffer line by line mostly does not work.

In fact, it works only if the edit buffer size is an exact multiple of the
line height.

In all other cases, the format rectangle is smaller than the client size,
and when
the edit control tries to redraw the last line, the update rectangle is
wrong : only the
lower part of the line is drawn.

I think that this problem can be traced to the replacement of code in
ScrollWindowEx
by the call to ScrollDC.

What is happening is that the client rectangle is scrolled, but the client
rectangle is
bigger than the formatting rectangle by a few pixels; these pixels are
missing in 
the update region.

In Wine previous version, the client rectangle was first ANDed with the
so-called
'visible region' (hvisRgn), so the result was not bigger than the format
rectangle
before being scrolled, then diff-ed with it.

The following patch works around this problem.

I don't have time to investigate further as I am taking one week of
holidays :-) but if someone is interested in the edit control....

Gerard


Index: dlls/x11drv/scroll.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/scroll.c,v
retrieving revision 1.2
diff -u -r1.2 scroll.c
--- dlls/x11drv/scroll.c        2001/06/20 00:18:48     1.2
+++ dlls/x11drv/scroll.c        2001/07/22 22:12:06
@@ -114,7 +114,7 @@
         hrgn2 = CreateRectRgnIndirect( &rect );
         if (hrgn) SetRectRgn( hrgn, rClip.left, rClip.top, rClip.right,
rClip.bottom );
         else hrgn = CreateRectRgn( rClip.left, rClip.top, rClip.right,
rClip.bottom );
-        CombineRgn( hrgn, hrgn, hrgn2, RGN_AND );
+        CombineRgn( hrgn2, hrgn, hrgn2, RGN_AND );
         OffsetRgn( hrgn2, dx, dy );
         CombineRgn( hrgn, hrgn, hrgn2, RGN_DIFF );





More information about the wine-devel mailing list