[try 2] winex11.drv: Check the valid rects after the set_window_pos
wineserver call
Pierre d'Herbemont
pdherbemont at free.fr
Mon Feb 5 12:40:14 CST 2007
Hi,
This patch is part of the SetWindowPos factorization attempts. This time
only the validated gets invalidated.
Pierre.
---
dlls/winex11.drv/winpos.c | 56
+++++++++++++++++++++++++++++---------------
1 files changed, 37 insertions(+), 19 deletions(-)
-------------- next part --------------
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index 95afc40..cf27b05 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,43 @@ 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 */
+ RECT invalid_rects[2]; /* Relative to the client area */
+ HRGN hrgn, tmp;
+
+ invalid_rects[0].top -= rectClient->top;
+ invalid_rects[0].left -= rectClient->left;
+ invalid_rects[0].bottom -= rectClient->top;
+ invalid_rects[0].right -= rectClient->left;
+
+ invalid_rects[1].top -= rectClient->top;
+ invalid_rects[1].left -= rectClient->left;
+ invalid_rects[1].bottom -= rectClient->top;
+ invalid_rects[1].right -= rectClient->left;
+
+ hrgn = CreateRectRgnIndirect(&invalid_rects[0]);
+ tmp = CreateRectRgnIndirect(&invalid_rects[1]);
+
+ CombineRgn(hrgn, hrgn, tmp, RGN_OR);
+
+ RedrawWindow( hwnd, NULL, hrgn, 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