From e8e51e9d792b63ade5b60381bcfdfd7d6f15ea3a Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Fri, 22 Jan 2021 16:06:50 +0100 Subject: [PATCH] only resize the GUI window if it was already open We already provide the correct size when opening it ourselves --- src/osdep/gui/main_window.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/osdep/gui/main_window.cpp b/src/osdep/gui/main_window.cpp index ba66d2ac5..80faf5001 100644 --- a/src/osdep/gui/main_window.cpp +++ b/src/osdep/gui/main_window.cpp @@ -432,16 +432,14 @@ void amiberry_gui_init() SDL_FreeSurface(icon_surface); } } - - if (mon->sdl_window) + else if (mon->sdl_window) { if (amiberry_options.rotation_angle != 0 && amiberry_options.rotation_angle != 180) SDL_SetWindowSize(mon->sdl_window, GUI_HEIGHT, GUI_WIDTH); else - SDL_SetWindowSize(mon->sdl_window, GUI_WIDTH, GUI_HEIGHT); - SDL_ShowWindow(mon->sdl_window); + SDL_SetWindowSize(mon->sdl_window, GUI_WIDTH, GUI_HEIGHT); } - + if (sdl_renderer == nullptr) { sdl_renderer = SDL_CreateRenderer(mon->sdl_window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);