diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-17 21:07:12 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-17 21:07:12 -0500 |
commit | 776c350eb654c78a21a6163dcc82d802039c76e6 (patch) | |
tree | 2c995e6e77bfd0436d560f6494af16a8b9a8c7e6 /util.hpp | |
parent | 58d0424dfc47e99c9c21396819a2234df158b4d0 (diff) | |
download | abaddon-portaudio-776c350eb654c78a21a6163dcc82d802039c76e6.tar.gz abaddon-portaudio-776c350eb654c78a21a6163dcc82d802039c76e6.zip |
make LaunchBrowser better
Diffstat (limited to 'util.hpp')
-rw-r--r-- | util.hpp | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -54,17 +54,10 @@ private: #include <shellapi.h> #endif -inline void LaunchBrowser(std::string url) { -#if defined(_WIN32) - // wtf i love the win32 api now ??? - ShellExecuteA(NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL); -#elif defined(__APPLE__) - std::system(("open " + url).c_str()); -#elif defined(__linux__) - std::system(("xdg-open " + url).c_str()); -#else - printf("can't open url on this platform\n"); -#endif +inline void LaunchBrowser(Glib::ustring url) { + GError *err = nullptr; + if (!gtk_show_uri_on_window(nullptr, url.c_str(), GDK_CURRENT_TIME, &err)) + printf("failed to open uri: %s\n", err->message); } inline void GetImageDimensions(int inw, int inh, int &outw, int &outh, int clampw = 400, int clamph = 300) { |