From bf8648375b0aa2e0e3af4766ade9e0d743c05942 Mon Sep 17 00:00:00 2001 From: Daniel Martin Date: Tue, 20 Oct 2026 10:29:13 +1000 Subject: [PATCH] demul: keep gaelco windowed at 4:3 on xorg --- .../batocera_launch/emulators/demul.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/python-src/batocera-launch/batocera_launch/emulators/demul.py b/python-src/batocera-launch/batocera_launch/emulators/demul.py index aeaf6d332d9..fbfbfb70d98 100644 --- a/python-src/batocera-launch/batocera_launch/emulators/demul.py +++ b/python-src/batocera-launch/batocera_launch/emulators/demul.py @@ -84,15 +84,11 @@ def in_game_ratio(self) -> float: @cached_property def gpu_resolution(self) -> tuple[int, int]: - # Gaelco's plugin takes its window and render size from this, and draws the picture to fill it. Under Wayland - # that is a window, so give it the largest box with the chosen aspect that fits the screen. Xorg is fullscreen. + # Gaelco's plugin takes its window and render size from this, and draws the picture to fill it, so give it the + # largest box with the chosen aspect that fits the screen. width, height = self.resolution.width, self.resolution.height - if ( - self.system == 'gaelco' - and 'WAYLAND_DISPLAY' in os.environ - and (ratio := self.config.get_int('demulRatio', 1)) != 0 - ): + if self.system == 'gaelco' and (ratio := self.config.get_int('demulRatio', 1)) != 0: target = 4 / 3 if ratio == 1 else 16 / 9 if width / height > target: @@ -210,10 +206,11 @@ async def configure(self) -> Command: ) # Handle window quirks with Demul systems: some systems start non-fullscreen - # and need a synthetic F3 (+ Alt+Enter under X11) to force fullscreen. + # and need a synthetic F3 (+ Alt+Enter under X11) to force fullscreen. Gaelco stays windowed, its plugin + # squeezes the picture in exclusive fullscreen. if self.system in ('cave3rd', 'gaelco'): trigger_cmd = 'sleep 5 && export DISPLAY=:0 && xdotool getactivewindow key F3' - if 'WAYLAND_DISPLAY' not in os.environ: + if self.system != 'gaelco' and 'WAYLAND_DISPLAY' not in os.environ: trigger_cmd += ' && xdotool getactivewindow key alt+Return' trigger_cmd += f' && {_CENTRE_WINDOW}'