mirror of
https://github.com/csd4ni3l/game-of-life.git
synced 2026-01-01 04:23:42 +01:00
Change 2nd window display behavior if Wayland detected
This commit is contained in:
17
run.py
17
run.py
@@ -2,7 +2,7 @@ import pyglet
|
|||||||
|
|
||||||
pyglet.options.debug_gl = False
|
pyglet.options.debug_gl = False
|
||||||
|
|
||||||
import logging, datetime, os, json, sys, arcade
|
import logging, datetime, os, json, sys, arcade, platform
|
||||||
|
|
||||||
# Set up paths BEFORE importing modules that load assets
|
# Set up paths BEFORE importing modules that load assets
|
||||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
@@ -47,6 +47,13 @@ if os.path.exists('settings.json'):
|
|||||||
else:
|
else:
|
||||||
antialiasing = 0
|
antialiasing = 0
|
||||||
|
|
||||||
|
# Wayland workaround (can be overridden with environment variable)
|
||||||
|
if (platform.system() == "Linux" and
|
||||||
|
os.environ.get("WAYLAND_DISPLAY") and
|
||||||
|
not os.environ.get("ARCADE_FORCE_MSAA")):
|
||||||
|
logging.info("Wayland detected - disabling MSAA (set ARCADE_FORCE_MSAA=1 to override)")
|
||||||
|
antialiasing = 0
|
||||||
|
|
||||||
fullscreen = settings['window_mode'] == 'Fullscreen'
|
fullscreen = settings['window_mode'] == 'Fullscreen'
|
||||||
style = arcade.Window.WINDOW_STYLE_BORDERLESS if settings['window_mode'] == 'borderless' else arcade.Window.WINDOW_STYLE_DEFAULT
|
style = arcade.Window.WINDOW_STYLE_BORDERLESS if settings['window_mode'] == 'borderless' else arcade.Window.WINDOW_STYLE_DEFAULT
|
||||||
vsync = settings['vsync']
|
vsync = settings['vsync']
|
||||||
@@ -54,6 +61,14 @@ if os.path.exists('settings.json'):
|
|||||||
else:
|
else:
|
||||||
resolution = get_closest_resolution()
|
resolution = get_closest_resolution()
|
||||||
antialiasing = 4
|
antialiasing = 4
|
||||||
|
|
||||||
|
# Wayland workaround (can be overridden with environment variable)
|
||||||
|
if (platform.system() == "Linux" and
|
||||||
|
os.environ.get("WAYLAND_DISPLAY") and
|
||||||
|
not os.environ.get("ARCADE_FORCE_MSAA")):
|
||||||
|
logging.info("Wayland detected - disabling MSAA (set ARCADE_FORCE_MSAA=1 to override)")
|
||||||
|
antialiasing = 0
|
||||||
|
|
||||||
fullscreen = False
|
fullscreen = False
|
||||||
style = arcade.Window.WINDOW_STYLE_DEFAULT
|
style = arcade.Window.WINDOW_STYLE_DEFAULT
|
||||||
vsync = True
|
vsync = True
|
||||||
|
|||||||
Reference in New Issue
Block a user