diff options
author | John Stebbins <[email protected]> | 2018-06-04 15:51:36 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2018-06-04 15:52:49 -0700 |
commit | 4553094c8fb2fa5a0412e466aa974dbc01aafeb6 (patch) | |
tree | b7bfc11e2c434838459db6f83bdc7386ffce80b5 /gtk | |
parent | ab936ca9a47de9ec6fe02abc4cfbaaef8c995a19 (diff) |
LinGui: open URLs with flatpak portal aware API
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/callbacks.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 30d237ce1..94e3f8b2c 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -4602,12 +4602,17 @@ ghb_log(gchar *log, ...) } static void -browse_url(const gchar *url) +browse_url(signal_user_data_t *ud, const gchar *url) { #if defined(_WIN32) ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL); #else - gboolean result; + GtkWindow * parent; + gboolean result; + + parent = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window")); + result = gtk_show_uri_on_window(parent, url, GDK_CURRENT_TIME, NULL); + if (result) return; char *argv[] = {"xdg-open",NULL,NULL,NULL}; argv[1] = (gchar*)url; @@ -4656,7 +4661,7 @@ about_action_cb(GSimpleAction *action, GVariant *param, signal_user_data_t *ud) G_MODULE_EXPORT void guide_action_cb(GSimpleAction *action, GVariant *param, signal_user_data_t *ud) { - browse_url(HB_DOCS); + browse_url(ud, HB_DOCS); } G_MODULE_EXPORT void |