[PATCH 2/5] winex11.drv: Separate the parts that should belongs to user32 (WND access and dce call) and those that are drivers specific

Pierre d'Herbemont pdherbemont at free.fr
Tue Jan 23 09:27:53 CST 2007


Hi,

One side effect of this patch is the invalidation of the DCE for the 
root window (if the flags are set accordingly). That wasn't done before. 
But after thinking a bit I don't see any reason it shouldn't.

Pierre.
---
  dlls/winex11.drv/winpos.c |   45 
+++++++++++++++++++++++----------------------
  1 files changed, 23 insertions(+), 22 deletions(-)
-------------- next part --------------
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index 422efd8..71c2855 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -259,8 +259,7 @@ BOOL X11DRV_GetVisibleRect( HWND hwnd, R
 BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow,
                                    const RECT *rectClient, UINT swp_flags, const RECT *valid_rects )
 {
-    struct x11drv_win_data *data;
-    RECT new_whole_rect, old_whole_rect, old_client_rect, old_screen_rect;
+    RECT new_whole_rect, old_whole_rect, old_screen_rect;
     WND *win;
     DWORD old_style, new_style;
     BOOL ret;
@@ -317,26 +316,12 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWN
     }
     SERVER_END_REQ;
 
-    if (!(data = X11DRV_get_win_data( hwnd ))) return FALSE;
-
-    old_client_rect = data->client_rect;
-
-    if (win == WND_DESKTOP || data->whole_window == DefaultRootWindow(gdi_display))
-    {
-        data->whole_rect = data->client_rect = data->window_rect = *rectWindow;
-        if (win != WND_DESKTOP)
-        {
-            win->rectWindow   = *rectWindow;
-            win->rectClient   = *rectClient;
-            win->dwStyle      = new_style;
-            WIN_ReleasePtr( win );
-        }
-        return ret;
-    }
 
     if (ret)
     {
+        struct x11drv_win_data *data;
         Display *display = thread_display();
+        RECT  old_client_rect;
 
         /* invalidate DCEs */
 
@@ -348,10 +333,26 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWN
             invalidate_dce( hwnd, &rect );
         }
 
-        win->rectWindow   = *rectWindow;
-        win->rectClient   = *rectClient;
-        old_style         = win->dwStyle;
-        win->dwStyle      = new_style;
+        old_style = win->dwStyle;
+
+        if (win != WND_DESKTOP)
+        {
+            win->rectWindow   = *rectWindow;
+            win->rectClient   = *rectClient;
+            win->dwStyle      = new_style;
+        }
+
+        if (!(data = X11DRV_get_win_data( hwnd ))) return FALSE;
+
+        if(hwnd == GetDesktopWindow() || data->whole_window == DefaultRootWindow(gdi_display))
+        {
+            data->whole_rect = data->client_rect = data->window_rect = *rectWindow;
+            WIN_ReleasePtr( win );
+            return ret;
+        }
+
+        old_client_rect   = data->client_rect;
+
         data->window_rect = *rectWindow;
 
         TRACE( "win %p window %s client %s style %08x\n",


More information about the wine-patches mailing list