mirror of
https://github.com/csd4ni3l/game-of-life.git
synced 2025-11-05 04:58:06 +01:00
Fixed double window issue on Linux
This commit is contained in:
7
run.py
7
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()
|
||||
|
||||
Reference in New Issue
Block a user