From fdc530b0bbdfbac5bc959efb319c55c938770613 Mon Sep 17 00:00:00 2001 From: Paul W Date: Thu, 21 Feb 2019 09:53:01 -0500 Subject: [PATCH] Implement openURL on Linux Implement openURL using xdg-open, the freedesktop.org command to open a resource in the default browser or viewer. Closes #638 menu manual on linux broken Incorporate @falkTX comments to use vfork rather than system --- src/linux/UserInteractionsLinux.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/linux/UserInteractionsLinux.cpp b/src/linux/UserInteractionsLinux.cpp index c64e34744f7..6f6a7481985 100644 --- a/src/linux/UserInteractionsLinux.cpp +++ b/src/linux/UserInteractionsLinux.cpp @@ -1,6 +1,8 @@ #include "UserInteractions.h" #include #include +#include +#include namespace Surge { @@ -31,6 +33,13 @@ namespace Surge void openURL(const std::string &url) { + if (vfork()==0) + { + if (execlp("xdg-open", "xdg-open", url.c_str(), (char*)NULL) < 0) + { + exit(0); + } + } } }; };