diff options
author | John Stebbins <[email protected]> | 2018-06-04 15:51:36 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2018-06-14 13:45:25 -0700 |
commit | a14fcf5114eaa185fa1217895fc96de1cbf109f0 (patch) | |
tree | c18ccc8737f425bccd95ebec4e435ad459afa479 /gtk | |
parent | 3dc76803a637bbdc4ae02b0054ea09bf25194a53 (diff) |
LinGui: open URLs with flatpak portal aware API
(cherry picked from commit 4553094c8fb2fa5a0412e466aa974dbc01aafeb6)
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 55b56fa43..d2e99f6cb 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 |