From 045606ce445b660890fbe53d041901e04b473e68 Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Sun, 8 Jul 2018 18:17:23 +0100 Subject: [PATCH] Restore refresh fix for windows The refresh rate is now detect to restore the original desktop resolution. --- gfx/display_servers/dispserv_win32.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gfx/display_servers/dispserv_win32.c b/gfx/display_servers/dispserv_win32.c index 243b0ecf2b..87100e8bdb 100644 --- a/gfx/display_servers/dispserv_win32.c +++ b/gfx/display_servers/dispserv_win32.c @@ -68,6 +68,7 @@ be received by your application before it calls any ITaskbarList3 method. static unsigned win32_orig_width = 0; static unsigned win32_orig_height = 0; +static unsigned win32_orig_refresh = 0; static void* win32_display_server_init(void) { @@ -106,7 +107,7 @@ static void win32_display_server_destroy(void *data) if (win32_orig_width > 0 && win32_orig_height > 0 ) video_display_server_switch_resolution(win32_orig_width, win32_orig_height, - 60, 60); + win32_orig_refresh , win32_orig_refresh ); #ifdef HAS_TASKBAR_EXT if (g_taskbarList && win32_taskbar_is_created()) @@ -214,14 +215,15 @@ static bool win32_display_server_set_resolution(void *data, if (!serv) return false; + + EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &curDevmode); if (win32_orig_width == 0) win32_orig_width = GetSystemMetrics(SM_CXSCREEN); + win32_orig_refresh = curDevmode.dmDisplayFrequency; if (win32_orig_height == 0) win32_orig_height = GetSystemMetrics(SM_CYSCREEN); - EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &curDevmode); - /* Used to stop super resolution bug */ if (width == curDevmode.dmPelsWidth) width = 0;