From e12d336359ec6ab2e35dec1639eb0fe3d655bc55 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sat, 21 Aug 2021 09:51:47 -0400 Subject: [PATCH] Branch around Juce Path Space bug Juce path process open has a bug where they double protect spaces in path names. Branch around this and also report it on juce forums. Closes #4820 --- src/gui/SurgeGUIUtils.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gui/SurgeGUIUtils.cpp b/src/gui/SurgeGUIUtils.cpp index 6335a0ac0ea..1f80a1edee0 100644 --- a/src/gui/SurgeGUIUtils.cpp +++ b/src/gui/SurgeGUIUtils.cpp @@ -2,7 +2,11 @@ #include "juce_core/juce_core.h" -#include +#if LINUX +#include +#include +#include +#endif namespace Surge { @@ -67,7 +71,19 @@ void openFileOrFolder(const std::string &f) if (path.isDirectory()) { + // See this for why we branch out linux here + // https://forum.juce.com/t/linux-spaces-in-path-startasprocess-and-process-opendocument/47296 +#if LINUX + if (vfork() == 0) + { + if (execlp("xdg-open", "xdg-open", f.c_str(), (char *)nullptr) < 0) + { + _exit(0); + } + } +#else path.startAsProcess(); +#endif } else {