gdi32: Reset the visible region in ResetDC.

This commit is contained in:
Alexandre Julliard 2009-11-17 15:14:11 +01:00
parent e4beddb664
commit c73e2d5e02
2 changed files with 11 additions and 5 deletions

View File

@ -859,7 +859,17 @@ HDC WINAPI ResetDCW( HDC hdc, const DEVMODEW *devmode )
if ((dc = get_dc_ptr( hdc )))
{
if (dc->funcs->pResetDC) ret = dc->funcs->pResetDC( dc->physDev, devmode );
if (dc->funcs->pResetDC)
{
ret = dc->funcs->pResetDC( dc->physDev, devmode );
if (ret) /* reset the visible region */
{
dc->dirty = 0;
SetRectRgn( dc->hVisRgn, 0, 0, GetDeviceCaps( hdc, DESKTOPHORZRES ),
GetDeviceCaps( hdc, DESKTOPVERTRES ) );
CLIPPING_UpdateGCRegion( dc );
}
}
release_dc_ptr( dc );
}
return ret;

View File

@ -401,14 +401,10 @@ BOOL CDECL PSDRV_DeleteDC( PSDRV_PDEVICE *physDev )
HDC CDECL PSDRV_ResetDC( PSDRV_PDEVICE *physDev, const DEVMODEW *lpInitData )
{
if(lpInitData) {
HRGN hrgn;
DEVMODEA *devmodeA = DEVMODEdupWtoA(PSDRV_Heap, lpInitData);
PSDRV_MergeDevmodes(physDev->Devmode, (PSDRV_DEVMODEA *)devmodeA, physDev->pi);
HeapFree(PSDRV_Heap, 0, devmodeA);
PSDRV_UpdateDevCaps(physDev);
hrgn = CreateRectRgn(0, 0, physDev->horzRes, physDev->vertRes);
SelectVisRgn( physDev->hdc, hrgn );
DeleteObject(hrgn);
}
return physDev->hdc;
}