winex11.drv: Check the valid rects after the set_window_pos wineserver call

Pierre d'Herbemont pdherbemont at free.fr
Sun Feb 4 16:31:26 CST 2007


Hi,

This patch is part of the SetWindowPos factorization attempts.

Pierre.

---
  dlls/winex11.drv/winpos.c |   39 ++++++++++++++++++++-------------------
  1 files changed, 20 insertions(+), 19 deletions(-)
-------------- next part --------------
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index 95afc40..da36636 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -258,25 +258,6 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWN
 
     old_client_rect = data->client_rect;
 
-    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;
-        }
-
-        if (x_offset != valid_rects[1].left - valid_rects[0].left ||
-            y_offset != valid_rects[1].top - valid_rects[0].top)
-        {
-            /* FIXME: should copy the window bits here */
-            valid_rects = NULL;
-        }
-    }
-
     if (!(win = WIN_GetPtr( hwnd ))) return FALSE;
     if (win == WND_OTHER_PROCESS)
     {
@@ -340,6 +321,26 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWN
         win->dwStyle      = new_style;
         data->window_rect = *rectWindow;
 
+        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;
+            }
+
+            if (x_offset != valid_rects[1].left - valid_rects[0].left ||
+                y_offset != valid_rects[1].top - valid_rects[0].top)
+            {
+                /* FIXME: should copy the window bits here */
+                /* Invalidate the validated rect in this case */
+                RedrawWindow( hwnd, NULL, NULL, RDW_INVALIDATE);
+            }
+        }
+
         TRACE( "win %p window %s client %s style %08x\n",
                hwnd, wine_dbgstr_rect(rectWindow), wine_dbgstr_rect(rectClient), new_style );
 


More information about the wine-patches mailing list