Alexandre Julliard : user32: Fix MapWindowPoints behavior in the process that owns the desktop window.

Alexandre Julliard julliard at winehq.org
Thu Sep 25 10:30:07 CDT 2008


Module: wine
Branch: stable
Commit: c13025c16b5d97f445d26f52e80bd2d86f64a612
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c13025c16b5d97f445d26f52e80bd2d86f64a612

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jul 22 15:31:04 2008 +0200

user32: Fix MapWindowPoints behavior in the process that owns the desktop window.
(cherry picked from commit 406f5b2545d553b36d370a913a8454078797b097)

---

 dlls/user32/painting.c |    2 ++
 dlls/user32/winpos.c   |   14 ++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index 436bd16..65f708e 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -623,6 +623,8 @@ static HRGN send_ncpaint( HWND hwnd, HWND *child, UINT *flags )
 
     if (child) hwnd = *child;
 
+    if (hwnd == GetDesktopWindow()) return whole_rgn;
+
     if (whole_rgn)
     {
         RECT client, update;
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 621f89a..2077dc6 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -434,8 +434,11 @@ static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset )
             }
             if (wndPtr == WND_DESKTOP) break;
             if (wndPtr == WND_OTHER_PROCESS) goto other_process;
-            offset->x += wndPtr->rectClient.left;
-            offset->y += wndPtr->rectClient.top;
+            if (wndPtr->parent)
+            {
+                offset->x += wndPtr->rectClient.left;
+                offset->y += wndPtr->rectClient.top;
+            }
             hwnd = wndPtr->parent;
             WIN_ReleasePtr( wndPtr );
         }
@@ -455,8 +458,11 @@ static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset )
             }
             if (wndPtr == WND_DESKTOP) break;
             if (wndPtr == WND_OTHER_PROCESS) goto other_process;
-            offset->x -= wndPtr->rectClient.left;
-            offset->y -= wndPtr->rectClient.top;
+            if (wndPtr->parent)
+            {
+                offset->x -= wndPtr->rectClient.left;
+                offset->y -= wndPtr->rectClient.top;
+            }
             hwnd = wndPtr->parent;
             WIN_ReleasePtr( wndPtr );
         }




More information about the wine-cvs mailing list