From ab7271b986e00dd1377b66dd1de72e03a67a8993 Mon Sep 17 00:00:00 2001 From: narzoul Date: Sun, 2 Jul 2017 16:38:31 +0200 Subject: [PATCH] Disable primary surface updates during display mode change --- DDrawCompat/Win32/DisplayMode.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DDrawCompat/Win32/DisplayMode.cpp b/DDrawCompat/Win32/DisplayMode.cpp index ef3770b..e8afbb0 100644 --- a/DDrawCompat/Win32/DisplayMode.cpp +++ b/DDrawCompat/Win32/DisplayMode.cpp @@ -4,6 +4,7 @@ #include "Common/CompatPtr.h" #include "Common/Hook.h" #include "DDraw/DirectDraw.h" +#include "DDraw/RealPrimarySurface.h" #include "Win32/DisplayMode.h" BOOL WINAPI DWM8And16Bit_IsShimApplied_CallOut() { return FALSE; }; @@ -52,6 +53,7 @@ namespace { prevDevMode.dmSize = sizeof(prevDevMode); origEnumDisplaySettingsEx(lpszDeviceName, ENUM_CURRENT_SETTINGS, &prevDevMode, 0); + DDraw::RealPrimarySurface::disableUpdates(); } BOOL result = FALSE; @@ -97,6 +99,11 @@ namespace } } + if (!(dwflags & CDS_TEST)) + { + DDraw::RealPrimarySurface::enableUpdates(); + } + return result; }