[try 3] winex11.drv: Check the valid rects after the set_window_pos
wineserver call
Pierre d'Herbemont
pdherbemont at free.fr
Mon Feb 5 17:59:31 CST 2007
I should really get more sleep.
Hope this one will be ok.
Sorry for the spam,
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..daff71e 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 = valid_rects[0].top - rectClient->top;
+ invalid_rects[0].left = valid_rects[0].left - rectClient->left;
+ invalid_rects[0].bottom = valid_rects[0].bottom - rectClient->top;
+ invalid_rects[0].right = valid_rects[0].right - rectClient->left;
+
+ invalid_rects[1].top = valid_rects[0].top - rectClient->top;
+ invalid_rects[1].left = valid_rects[0].left - rectClient->left;
+ invalid_rects[1].bottom = valid_rects[0].bottom - rectClient->top;
+ invalid_rects[1].right = valid_rects[0].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