From 11958dad04fa553ef8d95e8f07ef4c6f03b370d3 Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Sat, 31 Aug 2024 17:33:34 +0200 Subject: [PATCH] bugfix: KMSDRM fixes for when using a single window (fixes #1411) Disable integer scaling when opening the GUI, trigger an update of scaling options when resuming --- src/osdep/amiberry_gui.cpp | 4 ++++ src/osdep/gui/main_window.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/osdep/amiberry_gui.cpp b/src/osdep/amiberry_gui.cpp index a7617b46..9423932c 100644 --- a/src/osdep/amiberry_gui.cpp +++ b/src/osdep/amiberry_gui.cpp @@ -544,6 +544,10 @@ void gui_display(int shortcut) //rawinput_alloc(); struct AmigaMonitor* mon = &AMonitors[0]; SDL_SetWindowGrab(mon->amiga_window, SDL_TRUE); + if (kmsdrm_detected && amiga_surface != nullptr) + { + target_graphics_buffer_update(mon->monitor_id, true); + } fpscounter_reset(); //screenshot_free(); //write_disk_history(); diff --git a/src/osdep/gui/main_window.cpp b/src/osdep/gui/main_window.cpp index 6e73c8a9..07c0e79a 100644 --- a/src/osdep/gui/main_window.cpp +++ b/src/osdep/gui/main_window.cpp @@ -346,6 +346,10 @@ void amiberry_gui_init() SDL_FreeSurface(icon_surface); } } + else if (kmsdrm_detected) + { + SDL_SetWindowSize(mon->gui_window, GUI_WIDTH * amiberry_options.window_scaling, GUI_HEIGHT * amiberry_options.window_scaling); + } if (mon->gui_renderer == nullptr) { @@ -355,6 +359,8 @@ void amiberry_gui_init() // make the scaled rendering look smoother (linear scaling). SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); + // Disable integer scaling for the GUI + SDL_RenderSetIntegerScale(mon->gui_renderer, SDL_FALSE); gui_texture = SDL_CreateTexture(mon->gui_renderer, gui_screen->format->format, SDL_TEXTUREACCESS_STREAMING, gui_screen->w, gui_screen->h);