Skip to content

Commit

Permalink
bugfix: KMSDRM fixes for when using a single window (fixes #1411)
Browse files Browse the repository at this point in the history
Disable integer scaling when opening the GUI, trigger an update of scaling options when resuming
  • Loading branch information
midwan committed Aug 31, 2024
1 parent 9c050f8 commit 11958da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/osdep/amiberry_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions src/osdep/gui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
Expand Down

0 comments on commit 11958da

Please sign in to comment.