Skip to content

Commit

Permalink
enhancement: when KMSDRM or DMX is detected, force Full-Window mode
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Mar 26, 2024
1 parent d0bd57e commit 2428b30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/osdep/amiberry_gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,8 @@ int graphics_init(bool mousecapture)
SDL_WINDOW_FULLSCREEN_DESKTOP);
check_error_sdl(mon->sdl_window == nullptr, "Unable to create window");
}
write_log("Dispmanx detected, forcing Full-window mode\n");
currprefs.gfx_apmode[0].gfx_fullscreen = GFX_FULLWINDOW;
#else
write_log("Getting Current Video Driver...\n");
sdl_video_driver = SDL_GetCurrentVideoDriver();
Expand All @@ -2095,12 +2097,18 @@ int graphics_init(bool mousecapture)
mon->currentmode.freq = sdl_mode.refresh_rate;
}

// If KMSDRM is detected, force Full-window mode
if (kmsdrm_detected)
{
write_log("KMSDRM detected, forcing Full-window mode\n");
currprefs.gfx_apmode[0].gfx_fullscreen = GFX_FULLWINDOW;
}
write_log("Creating Amiberry window...\n");

if (!mon->sdl_window)
{
Uint32 sdl_window_mode;
if (sdl_mode.w >= 800 && sdl_mode.h >= 600 && !kmsdrm_detected)
if (sdl_mode.w >= 800 && sdl_mode.h >= 600)
{
// Only enable Windowed mode if we're running under x11 and the resolution is at least 800x600
if (currprefs.gfx_apmode[0].gfx_fullscreen == GFX_FULLWINDOW)
Expand Down
8 changes: 8 additions & 0 deletions src/osdep/gui/PanelDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,14 @@ void RefreshPanelDisplay()
chkAspect->setSelected(changed_prefs.gfx_correct_aspect);
chkFilterLowRes->setSelected(changed_prefs.gfx_lores_mode);

#ifdef USE_DISPMANX
cboScreenmode->setEnabled(false);
#endif
if (kmsdrm_detected)
{
cboScreenmode->setEnabled(false);
}

if (changed_prefs.gfx_apmode[0].gfx_fullscreen == GFX_WINDOW)
{
cboScreenmode->setSelected(0);
Expand Down

0 comments on commit 2428b30

Please sign in to comment.