Fix launching of pkexec applications

When launching mintsources, timeshift or an app which Exec field (in the desktop file)
starts with pkexec, nothing happens and the output states:

"Refusing to render service to dead parents."

For some reason this does not happen on fresh LMDE 4 and Mint 19.3 installations,
but it happens on LMDE 3 -> LMDE 4 and 19.1 -> 19.3 upgrades.

Similar bugs were fixed in nemo and cinnamon. Pkexec is known to cause issues
depending on how it's launched.

This introduces a workaround to wrap the pkexec call within an "sh -c".
This commit is contained in:
Clement Lefebvre 2020-03-30 14:35:07 +01:00
parent e603bee1f3
commit 29d14c01d1

View File

@ -348,6 +348,11 @@ class ApplicationLauncher(easyButton):
if os.path.exists("/usr/bin/mate-terminal"): if os.path.exists("/usr/bin/mate-terminal"):
cmd = "mate-terminal -e \"" + self.appExec + "\"" cmd = "mate-terminal -e \"" + self.appExec + "\""
Execute(cmd, self.appPath) Execute(cmd, self.appPath)
else:
if self.appExec.startswith("pkexec "):
print ("Using pkexec workaround...")
cmd = "sh -c \"" + self.appExec + "\""
Execute(cmd, self.appPath)
else: else:
Execute(None, desktopFile=self.desktopFile) Execute(None, desktopFile=self.desktopFile)