winex11.drv: Make sure that default clipping region exists before calling ExcludeUpdateRgn().

Dmitry Timoshkov dmitry at codeweavers.com
Mon Jan 31 05:30:43 CST 2011


If there is no current clipping region ExtSelectClipRgn(hdc, hrgn, RGN_DIFF)
creates its own default clipping region which in most cases doesn't match
neither a visible region nor the window extents attached to the DC.

This is hopefully a real fix for the regression reported in the bug 25107.
---
 dlls/winex11.drv/window.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 65c046b..082c928 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1605,7 +1605,7 @@ static void move_window_bits( struct x11drv_win_data *data, const RECT *old_rect
     RECT dst_rect = *new_rect;
     HDC hdc_src, hdc_dst;
     INT code;
-    HRGN rgn = 0;
+    HRGN rgn;
     HWND parent = 0;
 
     if (!data->whole_window)
@@ -1624,6 +1624,9 @@ static void move_window_bits( struct x11drv_win_data *data, const RECT *old_rect
         hdc_src = hdc_dst = GetDCEx( data->hwnd, 0, DCX_CACHE );
     }
 
+    rgn = CreateRectRgnIndirect( &dst_rect );
+    SelectClipRgn( hdc_dst, rgn );
+    DeleteObject( rgn );
     ExcludeUpdateRgn( hdc_dst, data->hwnd );
 
     code = X11DRV_START_EXPOSURES;
@@ -1636,6 +1639,7 @@ static void move_window_bits( struct x11drv_win_data *data, const RECT *old_rect
             dst_rect.right - dst_rect.left, dst_rect.bottom - dst_rect.top,
             hdc_src, src_rect.left, src_rect.top, SRCCOPY );
 
+    rgn = 0;
     code = X11DRV_END_EXPOSURES;
     ExtEscape( hdc_dst, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, sizeof(rgn), (LPSTR)&rgn );
 
-- 
1.7.3.5




More information about the wine-patches mailing list