Skip to content
Snippets Groups Projects
Commit 94463871 authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

Make the visible region empty for non-visible windows.

parent b91d2dfa
No related branches found
No related tags found
No related merge requests found
......@@ -380,6 +380,7 @@ BOOL X11DRV_GetDC( HWND hwnd, HDC hdc, HRGN hrgn, DWORD flags )
WND *ptr, *top;
X11DRV_WND_DATA *data = win->pDriverData;
Drawable drawable;
BOOL visible;
int org_x, org_y, mode = IncludeInferiors;
/* don't clip siblings if using parent clip region */
......@@ -387,10 +388,22 @@ BOOL X11DRV_GetDC( HWND hwnd, HDC hdc, HRGN hrgn, DWORD flags )
/* find the top parent in the hierarchy that isn't clipping siblings */
top = NULL;
for (ptr = win->parent; ptr && ptr->parent; ptr = ptr->parent)
if (!(ptr->dwStyle & WS_CLIPSIBLINGS)) top = ptr;
visible = (win->dwStyle & WS_VISIBLE) != 0;
if (!top && !(flags & DCX_CLIPSIBLINGS)) top = win;
if (visible)
{
for (ptr = win->parent; ptr && ptr->parent; ptr = ptr->parent)
{
if (!(ptr->dwStyle & WS_VISIBLE))
{
visible = FALSE;
top = NULL;
break;
}
if (!(ptr->dwStyle & WS_CLIPSIBLINGS)) top = ptr;
}
if (!top && visible && !(flags & DCX_CLIPSIBLINGS)) top = win;
}
if (top)
{
......@@ -438,13 +451,21 @@ BOOL X11DRV_GetDC( HWND hwnd, HDC hdc, HRGN hrgn, DWORD flags )
SetHookFlags16( hdc, DCHF_VALIDATEVISRGN )) /* DC was dirty */
{
/* need to recompute the visible region */
HRGN visRgn = get_visible_region( win, top, flags, mode );
HRGN visRgn;
if (visible)
{
visRgn = get_visible_region( win, top, flags, mode );
if (flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN))
CombineRgn( visRgn, visRgn, hrgn,
(flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF );
if (flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN))
CombineRgn( visRgn, visRgn, hrgn, (flags & DCX_INTERSECTRGN) ? RGN_AND : RGN_DIFF );
/* make it relative to the drawable origin */
OffsetRgn( visRgn, org_x, org_y );
}
else visRgn = CreateRectRgn( 0, 0, 0, 0 );
/* make it relative to the drawable origin */
OffsetRgn( visRgn, org_x, org_y );
SelectVisRgn16( hdc, visRgn );
DeleteObject( visRgn );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment