From 4cc3cf73446964864ef55990706dc46319354a2f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 16 Apr 2018 03:19:33 +0200 Subject: [PATCH] Only restore resolution through resolution switch if CRT switch mode was ever actually used --- gfx/video_driver.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 60f475de59..9d2a9b6d40 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -144,6 +144,7 @@ static void *video_driver_state_buffer = NULL; static unsigned video_driver_state_scale = 0; static unsigned video_driver_state_out_bpp = 0; static bool video_driver_state_out_rgb32 = false; +static bool video_driver_crt_switched = false; static bool video_driver_crt_switching_active = false; static struct retro_system_av_info video_driver_av_info; @@ -1571,7 +1572,13 @@ static void video_driver_lock_new(void) void video_driver_destroy(void) { video_display_server_destroy(); - crt_video_restore(); + + if (video_driver_crt_switched) + { + crt_video_restore(); + video_driver_crt_switched = false; + } + video_driver_cb_has_focus = null_driver_has_focus; video_driver_use_rgba = false; video_driver_data_own = false; @@ -2599,6 +2606,7 @@ void video_driver_frame(const void *data, unsigned width, /* trigger set resolution*/ if (video_info.crt_switch_resolution) { + video_driver_crt_switched = true; video_driver_crt_switching_active = true; if (video_info.crt_switch_resolution_super == 2560)