Commit 502d83b1 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed a few problems with DCX_* flags handling.

parent 111ec8d6
......@@ -283,7 +283,7 @@ HRESULT User_DirectDrawSurface_get_gamma_ramp(IDirectDrawSurfaceImpl* This,
HDC hDisplayDC;
HRESULT hr;
hDisplayWnd = get_display_window(This, &offset);
hDisplayDC = GetDCEx(hDisplayWnd, 0, DCX_CLIPSIBLINGS);
hDisplayDC = GetDCEx(hDisplayWnd, 0, DCX_CLIPSIBLINGS|DCX_CACHE);
hr = GetDeviceGammaRamp(hDisplayDC, lpGammaRamp) ? DD_OK : DDERR_UNSUPPORTED;
ReleaseDC(hDisplayWnd, hDisplayDC);
return hr;
......@@ -302,7 +302,7 @@ HRESULT User_DirectDrawSurface_set_gamma_ramp(IDirectDrawSurfaceImpl* This,
HDC hDisplayDC;
HRESULT hr;
hDisplayWnd = get_display_window(This, &offset);
hDisplayDC = GetDCEx(hDisplayWnd, 0, DCX_CLIPSIBLINGS);
hDisplayDC = GetDCEx(hDisplayWnd, 0, DCX_CLIPSIBLINGS|DCX_CACHE);
hr = SetDeviceGammaRamp(hDisplayDC, lpGammaRamp) ? DD_OK : DDERR_UNSUPPORTED;
ReleaseDC(hDisplayWnd, hDisplayDC);
return hr;
......@@ -477,7 +477,7 @@ static void User_copy_to_screen(IDirectDrawSurfaceImpl* This, LPCRECT rc)
return;
hDisplayWnd = get_display_window(This, &offset);
hDisplayDC = GetDCEx(hDisplayWnd, 0, DCX_CLIPSIBLINGS);
hDisplayDC = GetDCEx(hDisplayWnd, 0, DCX_CLIPSIBLINGS|DCX_CACHE);
#if 0
/* FIXME: this doesn't work... if users really want to run
* X in 8bpp, then we need to call directly into display.drv
......
......@@ -410,7 +410,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
/* fixup flags */
if (!wndPtr->dce) flags |= DCX_CACHE;
if (flags & (DCX_WINDOW | DCX_PARENTCLIP)) flags |= DCX_CACHE;
if (flags & DCX_USESTYLE)
{
......@@ -425,25 +425,26 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
if (wndPtr->dwStyle & WS_CLIPCHILDREN &&
!(wndPtr->dwStyle & WS_MINIMIZE) ) flags |= DCX_CLIPCHILDREN;
if (!wndPtr->dce) flags |= DCX_CACHE;
}
else flags |= DCX_CACHE;
}
if (flags & DCX_WINDOW)
flags = (flags & ~DCX_CLIPCHILDREN) | DCX_CACHE;
if (flags & DCX_WINDOW) flags &= ~DCX_CLIPCHILDREN;
if (!wndPtr->parent || (wndPtr->parent->hwndSelf == GetDesktopWindow()))
flags = (flags & ~DCX_PARENTCLIP) | DCX_CLIPSIBLINGS;
else if( flags & DCX_PARENTCLIP )
/* it seems parent clip is ignored when clipping siblings or children */
if (flags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN)) flags &= ~DCX_PARENTCLIP;
if( flags & DCX_PARENTCLIP )
{
flags |= DCX_CACHE;
if( !(flags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN)) )
if( (wndPtr->dwStyle & WS_VISIBLE) && (wndPtr->parent->dwStyle & WS_VISIBLE) )
{
flags &= ~DCX_CLIPCHILDREN;
if( wndPtr->parent->dwStyle & WS_CLIPSIBLINGS )
flags |= DCX_CLIPSIBLINGS;
}
if( (wndPtr->dwStyle & WS_VISIBLE) && (wndPtr->parent->dwStyle & WS_VISIBLE) )
{
flags &= ~DCX_CLIPCHILDREN;
if( wndPtr->parent->dwStyle & WS_CLIPSIBLINGS )
flags |= DCX_CLIPSIBLINGS;
}
}
/* find a suitable DCE */
......@@ -496,7 +497,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
else
{
dce = wndPtr->dce;
if( dce->hwndCurrent == hwnd )
if (dce && dce->hwndCurrent == hwnd)
{
TRACE("\tskipping hVisRgn update\n");
bUpdateVisRgn = FALSE; /* updated automatically, via DCHook() */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment