1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Fixed clipping of desktop DC

This commit is contained in:
narzoul 2021-01-02 16:14:58 +01:00
parent a0919dcaa6
commit 481b09f489

View File

@ -203,11 +203,18 @@ namespace Gdi
POINT origin = {};
GetDCOrgEx(origDc, &origin);
const HWND hwnd = CALL_ORIG_FUNC(WindowFromDC)(origDc);
if (hwnd && GetDesktopWindow() != hwnd)
HWND hwnd = CALL_ORIG_FUNC(WindowFromDC)(origDc);
if (hwnd)
{
origin.x -= virtualScreenBounds.left;
origin.y -= virtualScreenBounds.top;
if (GetDesktopWindow() == hwnd)
{
hwnd = nullptr;
}
else
{
origin.x -= virtualScreenBounds.left;
origin.y -= virtualScreenBounds.top;
}
}
compatDc.refCount = 1;