Vincent Povirk : user32: Also change rcUpdate when scrolling by more than the window size.

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 20 11:27:54 CDT 2016


Module: wine
Branch: master
Commit: 1383012395810e503ef5728a7ead24189e66fee4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1383012395810e503ef5728a7ead24189e66fee4

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Thu May 19 15:17:20 2016 -0500

user32: Also change rcUpdate when scrolling by more than the window size.

Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/painting.c  |  7 +++++++
 dlls/user32/tests/win.c | 16 +++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index 5855314..9e5bc0a 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -1501,6 +1501,13 @@ static INT scroll_window( HWND hwnd, INT dx, INT dy, const RECT *rect, const REC
                 CombineRgn( hrgnTemp, hrgnTemp, hrgnClip, RGN_AND );
                 CombineRgn( hrgnUpdate, hrgnUpdate, hrgnTemp, RGN_OR );
 
+                if (rcUpdate)
+                {
+                    RECT rcTemp;
+                    GetRgnBox( hrgnTemp, &rcTemp );
+                    UnionRect( rcUpdate, rcUpdate, &rcTemp );
+                }
+
                 if( !bOwnRgn)
                     CombineRgn( hrgnWinupd, hrgnWinupd, hrgnTemp, RGN_OR );
             }
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 991ea66..138a6f1 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -4841,11 +4841,25 @@ static void test_scrollvalidate( HWND parent)
             rcu.left,rcu.top,rcu.right,rcu.bottom);
     ReleaseDC( hwnd1, hdc);
 
-    /* test scrolling a window with an update region */
+    /* test scrolling a rect by more than its size */
     DestroyWindow( hwnd2);
     ValidateRect( hwnd1, NULL);
     SetRect( &rc, 40,40, 50,50);
     InvalidateRect( hwnd1, &rc, 1);
+    ScrollWindowEx( hwnd1, -20, 0, &rc, NULL, hrgn, &rcu,
+      SW_SCROLLCHILDREN | SW_INVALIDATE);
+    if (winetest_debug > 0) dump_region(hrgn);
+    SetRectRgn( exprgn, 20, 40, 30, 50);
+    SetRectRgn( tmprgn, 40, 40, 50, 50);
+    CombineRgn( exprgn, exprgn, tmprgn, RGN_OR);
+    ok( EqualRgn( exprgn, hrgn), "wrong update region\n");
+    ok( rcu.left == 20 && rcu.top == 40 && rcu.right == 50 && rcu.bottom == 50,
+        "unexpected update rect: %d,%d - %d,%d\n", rcu.left,rcu.top,rcu.right,rcu.bottom);
+
+    /* test scrolling a window with an update region */
+    ValidateRect( hwnd1, NULL);
+    SetRect( &rc, 40,40, 50,50);
+    InvalidateRect( hwnd1, &rc, 1);
     GetClientRect( hwnd1, &rc);
     cliprc=rc;
     ScrollWindowEx( hwnd1, -10, 0, &rc, &cliprc, hrgn, &rcu,




More information about the wine-cvs mailing list