Add workaround for alt+tab issues on windows 7 SP1 (opengl)

This commit is contained in:
FunkyFr3sh 2024-05-04 07:19:02 +02:00
parent 8d97550c2b
commit 64c4b73853
3 changed files with 124 additions and 4 deletions

View file

@ -4,6 +4,9 @@
#include "debug.h"
#include "hook.h"
#include "config.h"
#include "render_ogl.h"
#include "versionhelpers.h"
FPSLIMITER g_fpsl;
@ -153,8 +156,17 @@ void fpsl_frame_end()
if (g_config.maxfps < 0 ||
(g_config.vsync && (!g_config.maxfps || g_config.maxfps >= g_ddraw.mode.dmDisplayFrequency)))
{
if (fpsl_dwm_flush() || fpsl_wait_for_vblank())
return;
/* Workaround for DwmFlush() freeze (e.g. slow alt+tab) issue on windows 7 SP1 */
if (g_ddraw.renderer == ogl_render_main && !g_config.is_wine && !IsWindows8OrGreater())
{
if (fpsl_wait_for_vblank())
return;
}
else
{
if (fpsl_dwm_flush() || fpsl_wait_for_vblank())
return;
}
}
if (g_fpsl.tick_length > 0)