From 3a56a8a004f7c797ce7bbd20c8487d5f6fd474a5 Mon Sep 17 00:00:00 2001 From: marioalexis Date: Thu, 17 Oct 2024 01:03:43 -0300 Subject: [PATCH] Fem: Set startupinfo for gmsh subprocess - fixes #17298 --- src/Mod/Fem/femmesh/gmshtools.py | 13 +++++++++++-- src/Mod/Fem/femtools/femutils.py | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Mod/Fem/femmesh/gmshtools.py b/src/Mod/Fem/femmesh/gmshtools.py index 0a9bd5419f..9cc53dcf71 100644 --- a/src/Mod/Fem/femmesh/gmshtools.py +++ b/src/Mod/Fem/femmesh/gmshtools.py @@ -215,7 +215,11 @@ class GmshTools: command_list = [self.gmsh_bin, "-", self.temp_file_geo] self.process = subprocess.Popen( - command_list, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE + command_list, + shell=False, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + startupinfo=femutils.startProgramInfo("hide"), ) out, err = self.process.communicate() @@ -445,6 +449,7 @@ class GmshTools: stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, + startupinfo=femutils.startProgramInfo("hide"), ) except Exception as e: Console.PrintMessage(str(e) + "\n") @@ -926,7 +931,11 @@ class GmshTools: # print(command_list) try: p = subprocess.Popen( - command_list, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE + command_list, + shell=False, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + startupinfo=femutils.startProgramInfo("hide"), ) output, error = p.communicate() error = error.decode("utf-8") diff --git a/src/Mod/Fem/femtools/femutils.py b/src/Mod/Fem/femtools/femutils.py index b7e92a0c77..af96a46be6 100644 --- a/src/Mod/Fem/femtools/femutils.py +++ b/src/Mod/Fem/femtools/femutils.py @@ -368,6 +368,8 @@ def startProgramInfo(code): info.wShowWindow = SW_DEFAULT info.dwFlags = subprocess.STARTF_USESHOWWINDOW return info + else: + return None def expandParentObject():