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

Fixed mouse trail issue in Deadlock 2's help screen

The previous GDI synchronization overhaul introduced mouse trails in Deadlock 2.
To resolve it, the scope of the GDI critical section was extended to the entire
getCompatDc/releaseCompatDc functions.
Not sure why this helps as I didn't care to debug the issue deeply enough,
but it happens to work so I'll leave it at that for now.
This commit is contained in:
narzoul 2015-12-31 14:31:02 +01:00
parent 9b62f21a3d
commit e5fd3a9e16

View File

@ -1,7 +1,6 @@
#define CINTERFACE
#define WIN32_LEAN_AND_MEAN
#include <atomic>
#include <unordered_map>
#include <oleacc.h>
@ -42,7 +41,7 @@ namespace
HWND rootWnd;
};
std::atomic<bool> g_suppressGdiHooks = false;
bool g_suppressGdiHooks = false;
class HookRecursionGuard
{
@ -205,12 +204,12 @@ namespace
HDC getCompatDc(HWND hwnd, HDC origDc, const POINT& origin)
{
GdiScopedThreadLock gdiLock;
if (!CompatPrimarySurface::surfacePtr || !origDc || !RealPrimarySurface::isFullScreen() || g_suppressGdiHooks)
{
return origDc;
}
GdiScopedThreadLock gdiLock;
HookRecursionGuard recursionGuard;
IDirectDrawSurface7* surface = createGdiSurface();
@ -313,12 +312,12 @@ namespace
HDC releaseCompatDc(HDC hdc)
{
GdiScopedThreadLock gdiLock;
if (g_suppressGdiHooks)
{
return hdc;
}
GdiScopedThreadLock gdiLock;
HookRecursionGuard recursionGuard;
auto it = g_dcToSurface.find(hdc);