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 = {}; POINT origin = {};
GetDCOrgEx(origDc, &origin); GetDCOrgEx(origDc, &origin);
const HWND hwnd = CALL_ORIG_FUNC(WindowFromDC)(origDc); HWND hwnd = CALL_ORIG_FUNC(WindowFromDC)(origDc);
if (hwnd && GetDesktopWindow() != hwnd) if (hwnd)
{ {
origin.x -= virtualScreenBounds.left; if (GetDesktopWindow() == hwnd)
origin.y -= virtualScreenBounds.top; {
hwnd = nullptr;
}
else
{
origin.x -= virtualScreenBounds.left;
origin.y -= virtualScreenBounds.top;
}
} }
compatDc.refCount = 1; compatDc.refCount = 1;