From 3cb59bd70660014ae9b72f027099a2e8952f62c6 Mon Sep 17 00:00:00 2001 From: Brandon Corfman Date: Sat, 1 Nov 2025 13:29:37 -0400 Subject: [PATCH] Fixed double window issue on Linux --- run.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index 0c767fa..8b59a05 100644 --- a/run.py +++ b/run.py @@ -93,10 +93,10 @@ if settings.get("music", True): theme_sound.play(volume=settings.get("music_volume", 50) / 100, loop=True) try: - window = ControllerWindow(width=resolution[0], height=resolution[1], title='Game Of Life', samples=antialiasing, antialiasing=antialiasing > 0, fullscreen=fullscreen, vsync=vsync, resizable=False, style=style) + window = ControllerWindow(width=resolution[0], height=resolution[1], title='Game Of Life', samples=antialiasing, antialiasing=antialiasing > 0, fullscreen=fullscreen, vsync=vsync, resizable=False, style=style, visible=False) except (FileNotFoundError, PermissionError) as e: logging.warning(f"Controller support unavailable: {e}. Falling back to regular window.") - window = arcade.Window(width=resolution[0], height=resolution[1], title='Game Of Life', samples=antialiasing, antialiasing=antialiasing > 0, fullscreen=fullscreen, vsync=vsync, resizable=False, style=style) + window = arcade.Window(width=resolution[0], height=resolution[1], title='Game Of Life', samples=antialiasing, antialiasing=antialiasing > 0, fullscreen=fullscreen, vsync=vsync, resizable=False, style=style, visible=False) if vsync: window.set_vsync(True) @@ -121,6 +121,9 @@ main = Main() window.show_view(main) +# Make window visible after all setup is complete (helps prevent double window on Wayland) +window.set_visible(True) + logging.debug('Game started.') arcade.run()