Skip to content

Commit

Permalink
refactor: return to previous approach: GUI window is always Windowed,…
Browse files Browse the repository at this point in the history
… except on KMSDRM (#1351)

Due to how modern Window Managers handle things, if we open the GUI in full-window while the emulation screen is also opened in full-window, the second one gets minimized. That means that when we resume from the GUI, we don't get back to the emulation screen, even if we call for SDL_RaiseWindow() - it gets ignored.

To resolve this, I'm reverting this behavior to the previous approach: The GUI is always Windowed, and opens on top of the emulation screen. The exception is when we're using KMSDRM, which doesn't have the notion of windows.

But under KMSDRM we might run into a similar problem as well, so that needs a separate solution.
  • Loading branch information
midwan committed Jun 16, 2024
1 parent 5c25acf commit 5032afc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/osdep/gui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,10 @@ void amiberry_gui_init()
{
write_log("Creating Amiberry GUI window...\n");
Uint32 mode;
if (sdl_mode.w >= 800 && sdl_mode.h >= 600)
if (sdl_mode.w >= 800 && sdl_mode.h >= 600 && !kmsdrm_detected)
{
// Only enable Windowed mode if we're running under x11 and the resolution is at least 800x600
if (currprefs.gfx_apmode[APMODE_NATIVE].gfx_fullscreen == GFX_FULLWINDOW)
mode = SDL_WINDOW_FULLSCREEN_DESKTOP;
else if (currprefs.gfx_apmode[APMODE_NATIVE].gfx_fullscreen == GFX_FULLSCREEN)
mode = SDL_WINDOW_FULLSCREEN;
else
mode = SDL_WINDOW_RESIZABLE;
mode = SDL_WINDOW_RESIZABLE;
if (currprefs.gui_alwaysontop)
mode |= SDL_WINDOW_ALWAYS_ON_TOP;
if (currprefs.start_minimized)
Expand Down

0 comments on commit 5032afc

Please sign in to comment.