[PATCH 1/4 - try2] winex11.drv: Make SetWindowPos compute the valid rects using user32's win->rectWindow

Pierre d'Herbemont pdherbemont at free.fr
Wed Jan 24 08:01:28 CST 2007


Updated version of my previous patches to factorize SetWindowPos.

Pierre.
---
  dlls/winex11.drv/winpos.c |   19 ++++++++++---------
  1 files changed, 10 insertions(+), 9 deletions(-)
-------------- next part --------------
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index 95afc40..1991b82 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -258,15 +258,22 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWN
 
     old_client_rect = data->client_rect;
 
+    if (!(win = WIN_GetPtr( hwnd ))) return FALSE;
+    if (win == WND_OTHER_PROCESS)
+    {
+        if (IsWindow( hwnd )) ERR( "cannot set rectangles of other process window %p\n", hwnd );
+        return FALSE;
+    }
+
     if (!IsRectEmpty( &valid_rects[0] ))
     {
         int x_offset = 0, y_offset = 0;
 
         if (data->whole_window)
         {
-            /* the X server will move the bits for us */
-            x_offset = data->whole_rect.left - new_whole_rect.left;
-            y_offset = data->whole_rect.top - new_whole_rect.top;
+            /* the graphics driver will move the bits for us */
+            x_offset = win->rectWindow.left - rectWindow->left;
+            y_offset = win->rectWindow.top - rectWindow->top;
         }
 
         if (x_offset != valid_rects[1].left - valid_rects[0].left ||
@@ -277,12 +284,6 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWN
         }
     }
 
-    if (!(win = WIN_GetPtr( hwnd ))) return FALSE;
-    if (win == WND_OTHER_PROCESS)
-    {
-        if (IsWindow( hwnd )) ERR( "cannot set rectangles of other process window %p\n", hwnd );
-        return FALSE;
-    }
     SERVER_START_REQ( set_window_pos )
     {
         req->handle        = hwnd;


More information about the wine-patches mailing list