Skip to content

Commit

Permalink
Implement openURL on Linux
Browse files Browse the repository at this point in the history
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
  • Loading branch information
baconpaul committed Feb 21, 2019
1 parent 431588d commit 9e205e8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/linux/UserInteractionsLinux.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "UserInteractions.h"
#include <iostream>
#include <iomanip>
#include <sys/types.h>
#include <unistd.h>

namespace Surge
{
Expand Down Expand Up @@ -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);
}
}
}
};
};
Expand Down

0 comments on commit 9e205e8

Please sign in to comment.