From 8d40555bf5208d079311e57060ee32bc5e3fa5eb Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 29 Nov 2021 14:55:31 -0800 Subject: [PATCH] Prevent background windows from popping up for subprocess calls in Windows --- dangerzone/gui/main_window.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dangerzone/gui/main_window.py b/dangerzone/gui/main_window.py index 5cb04d2..f2a3974 100644 --- a/dangerzone/gui/main_window.py +++ b/dangerzone/gui/main_window.py @@ -162,6 +162,7 @@ class WaitingWidget(QtWidgets.QWidget): [container_runtime, "image", "ls"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, + startupinfo=self.global_common.get_subprocess_startupinfo(), ) as p: p.communicate() if p.returncode != 0: @@ -607,7 +608,9 @@ class ConvertWidget(QtWidgets.QWidget): if platform.system() == "Windows": dest_filename_windows = self.common.output_filename.replace("/", "\\") subprocess.Popen( - f'explorer.exe /select,"{dest_filename_windows}"', shell=True + f'explorer.exe /select,"{dest_filename_windows}"', + shell=True, + startupinfo=self.global_common.get_subprocess_startupinfo(), ) # Open