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