From 9e205e8caab5e6ea7b743a7ccaf3ea795067054c 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..ab025e52d22 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*)nullptr) < 0) + { + exit(0); + } + } } }; };