Prevent background windows from popping up for subprocess calls in Windows

This commit is contained in:
Micah Lee 2021-11-29 14:55:31 -08:00
parent ee04570048
commit 8d40555bf5
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -162,6 +162,7 @@ class WaitingWidget(QtWidgets.QWidget):
[container_runtime, "image", "ls"], [container_runtime, "image", "ls"],
stdout=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
startupinfo=self.global_common.get_subprocess_startupinfo(),
) as p: ) as p:
p.communicate() p.communicate()
if p.returncode != 0: if p.returncode != 0:
@ -607,7 +608,9 @@ class ConvertWidget(QtWidgets.QWidget):
if platform.system() == "Windows": if platform.system() == "Windows":
dest_filename_windows = self.common.output_filename.replace("/", "\\") dest_filename_windows = self.common.output_filename.replace("/", "\\")
subprocess.Popen( 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 # Open