Skip to content

Commit

Permalink
only resize the GUI window if it was already open
Browse files Browse the repository at this point in the history
We already provide the correct size when opening it ourselves
  • Loading branch information
midwan committed Jan 22, 2021
1 parent fd17b66 commit e8e51e9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/osdep/gui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e8e51e9

Please # to comment.