diff --git a/DDrawCompat/Gdi/Dc.cpp b/DDrawCompat/Gdi/Dc.cpp index 1787424..30ddba6 100644 --- a/DDrawCompat/Gdi/Dc.cpp +++ b/DDrawCompat/Gdi/Dc.cpp @@ -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;