diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index 1cb420c4944..3486a1867f6 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -268,13 +268,13 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode ) /*********************************************************************** * __wine_set_visible_region (GDI32.@) */ -void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect ) +void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, const RECT *device_rect ) { DC * dc; if (!(dc = get_dc_ptr( hdc ))) return; - TRACE( "%p %p %s\n", hdc, hrgn, wine_dbgstr_rect(vis_rect) ); + TRACE( "%p %p %s %s\n", hdc, hrgn, wine_dbgstr_rect(vis_rect), wine_dbgstr_rect(device_rect) ); /* map region to DC coordinates */ OffsetRgn( hrgn, -vis_rect->left, -vis_rect->top ); @@ -282,6 +282,7 @@ void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect ) if (dc->hVisRgn) DeleteObject( dc->hVisRgn ); dc->dirty = 0; dc->vis_rect = *vis_rect; + dc->device_rect = *device_rect; dc->hVisRgn = hrgn; DC_UpdateXforms( dc ); update_dc_clipping( dc ); @@ -415,8 +416,6 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect ) if (get_dc_region( dc )) { ret = GetRgnBox( get_dc_region( dc ), rect ); - if (get_dc_device_rect( dc, &visrect ) && !intersect_rect( rect, rect, &visrect )) - ret = NULLREGION; } else { @@ -424,6 +423,8 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect ) *rect = dc->vis_rect; } + if (get_dc_device_rect( dc, &visrect ) && !intersect_rect( rect, rect, &visrect )) ret = NULLREGION; + if (dc->layout & LAYOUT_RTL) { int tmp = rect->left; diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 1e30485b853..dfb87322971 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -511,7 +511,7 @@ # GDI objects @ cdecl __wine_make_gdi_object_system(long long) -@ cdecl __wine_set_visible_region(long long ptr) +@ cdecl __wine_set_visible_region(long long ptr ptr) # OpenGL @ cdecl __wine_get_wgl_driver(long long) diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c index 64f4318f682..d6b5aaf7955 100644 --- a/dlls/user32/painting.c +++ b/dlls/user32/painting.c @@ -161,7 +161,8 @@ static void update_visible_region( struct dce *dce ) if (dce->clip_rgn) CombineRgn( vis_rgn, vis_rgn, dce->clip_rgn, (flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF ); - __wine_set_visible_region( dce->hdc, vis_rgn, &win_rect ); + top_rect = get_virtual_screen_rect(); + __wine_set_visible_region( dce->hdc, vis_rgn, &win_rect, &top_rect ); } diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 2f316280556..6605c672823 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -236,7 +236,8 @@ WINGDIAPI BOOL WINAPI SetDCHook(HDC,DCHOOKPROC,DWORD_PTR); WINGDIAPI WORD WINAPI SetHookFlags(HDC,WORD); extern void CDECL __wine_make_gdi_object_system( HGDIOBJ handle, BOOL set ); -extern void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect ); +extern void CDECL __wine_set_visible_region( HDC hdc, HRGN hrgn, const RECT *vis_rect, + const RECT *device_rect ); extern struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version ); #endif /* __WINE_WINE_GDI_DRIVER_H */