diff --git a/src/testium/main_win/test_file_manager.py b/src/testium/main_win/test_file_manager.py index 4b58aaa..a05f567 100644 --- a/src/testium/main_win/test_file_manager.py +++ b/src/testium/main_win/test_file_manager.py @@ -212,8 +212,17 @@ class TestFileManager: d = "" if w.testFile is not None: d = os.path.dirname(w.testFile) + # In Flatpak the native dialog goes through the XDG document portal, + # which returns /run/user/UID/doc/.../test.tum and only exposes the + # selected file — sibling files (param.yaml, .py, etc.) are unreachable. + # Force Qt's own dialog, which walks the real filesystem mounted via + # --filesystem=home and returns a regular path with sibling access. + options = QFileDialog.Options() + if os.path.isfile("/.flatpak-info"): + options |= QFileDialog.Option.DontUseNativeDialog file_name, _ = QFileDialog.getOpenFileName( - w, "Open the test file", d, "testium file (*.tum);;All Files (*)" + w, "Open the test file", d, + "testium file (*.tum);;All Files (*)", options=options ) if file_name: self.reload(file_name)