Alexandre Julliard : user32: Fix coordinates mapping for the desktop window in the explorer process.

Alexandre Julliard julliard at winehq.org
Mon Dec 13 10:43:20 CST 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec 13 12:42:19 2010 +0100

user32: Fix coordinates mapping for the desktop window in the explorer process.

---

 dlls/user32/win.c    |    7 +++++--
 dlls/user32/winpos.c |    6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index f1da48b..b61d183 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -740,8 +740,11 @@ BOOL WIN_GetRectangles( HWND hwnd, enum coords_relative relative, RECT *rectWind
                     goto other_process;
                 }
                 win = parent;
-                OffsetRect( &window_rect, win->rectClient.left, win->rectClient.top );
-                OffsetRect( &client_rect, win->rectClient.left, win->rectClient.top );
+                if (win->parent)
+                {
+                    OffsetRect( &window_rect, win->rectClient.left, win->rectClient.top );
+                    OffsetRect( &client_rect, win->rectClient.left, win->rectClient.top );
+                }
             }
             break;
         }
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 6b623d2..03c16c9 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -445,7 +445,7 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
                 mirror_from = TRUE;
                 offset.x += wndPtr->rectClient.right - wndPtr->rectClient.left;
             }
-            for (;;)
+            while (wndPtr->parent)
             {
                 offset.x += wndPtr->rectClient.left;
                 offset.y += wndPtr->rectClient.top;
@@ -460,6 +460,7 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
                     goto other_process;
                 }
             }
+            if (wndPtr && wndPtr != WND_DESKTOP) WIN_ReleasePtr( wndPtr );
         }
     }
 
@@ -475,7 +476,7 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
                 mirror_to = TRUE;
                 offset.x -= wndPtr->rectClient.right - wndPtr->rectClient.left;
             }
-            for (;;)
+            while (wndPtr->parent)
             {
                 offset.x -= wndPtr->rectClient.left;
                 offset.y -= wndPtr->rectClient.top;
@@ -490,6 +491,7 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
                     goto other_process;
                 }
             }
+            if (wndPtr && wndPtr != WND_DESKTOP) WIN_ReleasePtr( wndPtr );
         }
     }
 




More information about the wine-cvs mailing list