[2/3] user32: SetWindowPos() should check the final window position in screen coords before adding SWP_NOMOVE.

Dmitry Timoshkov dmitry at codeweavers.com
Thu Feb 10 02:47:22 CST 2011


---
 dlls/user32/winpos.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 03c16c9..5907194 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -1848,6 +1848,7 @@ static BOOL fixup_flags( WINDOWPOS *winpos )
 {
     HWND parent;
     RECT window_rect;
+    POINT pt;
     WND *wndPtr = WIN_GetPtr( winpos->hwnd );
     BOOL ret = TRUE;
 
@@ -1879,12 +1880,15 @@ static BOOL fixup_flags( WINDOWPOS *winpos )
         if (!(winpos->flags & SWP_SHOWWINDOW)) winpos->flags |= SWP_NOREDRAW;
     }
 
-    WIN_GetRectangles( winpos->hwnd, COORDS_PARENT, &window_rect, NULL );
+    WIN_GetRectangles( winpos->hwnd, COORDS_SCREEN, &window_rect, NULL );
     if ((window_rect.right - window_rect.left == winpos->cx) &&
         (window_rect.bottom - window_rect.top == winpos->cy))
         winpos->flags |= SWP_NOSIZE;    /* Already the right size */
 
-    if ((window_rect.left == winpos->x) && (window_rect.top == winpos->y))
+    pt.x = winpos->x;
+    pt.y = winpos->y;
+    ClientToScreen( parent, &pt );
+    if ((window_rect.left == pt.x) && (window_rect.top == pt.y))
         winpos->flags |= SWP_NOMOVE;    /* Already the right position */
 
     if ((wndPtr->dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)
-- 
1.7.3.5




More information about the wine-patches mailing list