dialog_env: pick wayland/xcb from $DISPLAY/$WAYLAND_DISPLAY

Was forcing xcb unconditionally, which hung dialogs on pure-Wayland sessions.
This commit is contained in:
2026-05-07 10:03:54 +02:00
parent ddb18abc21
commit f17ef8a3a1

View File

@@ -10,6 +10,8 @@ import os
def setup():
"""Configure the Qt environment for dialog subprocess usage."""
if sys.platform.startswith('linux'):
# On Linux/Wayland, force X11 (via XWayland) to avoid crashes
# when Qt is initialized inside a multiprocessing subprocess.
if os.environ.get('DISPLAY'):
# X11 available: force xcb to avoid crashes in multiprocessing subprocesses.
os.environ['QT_QPA_PLATFORM'] = 'xcb'
elif os.environ.get('WAYLAND_DISPLAY'):
os.environ['QT_QPA_PLATFORM'] = 'wayland'