From f17ef8a3a190332450f69f92b9f251ef2caeabc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Thu, 7 May 2026 10:03:54 +0200 Subject: [PATCH] dialog_env: pick wayland/xcb from $DISPLAY/$WAYLAND_DISPLAY Was forcing xcb unconditionally, which hung dialogs on pure-Wayland sessions. --- src/testium/interpreter/test_items/dialog_env.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/testium/interpreter/test_items/dialog_env.py b/src/testium/interpreter/test_items/dialog_env.py index 35d690e..29199ac 100644 --- a/src/testium/interpreter/test_items/dialog_env.py +++ b/src/testium/interpreter/test_items/dialog_env.py @@ -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. - os.environ['QT_QPA_PLATFORM'] = 'xcb' + 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'