]> granicus.if.org Git - handbrake/commitdiff
LinGui: open URLs with flatpak portal aware API
authorJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 4 Jun 2018 22:51:36 +0000 (15:51 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 14 Jun 2018 20:45:25 +0000 (13:45 -0700)
(cherry picked from commit 4553094c8fb2fa5a0412e466aa974dbc01aafeb6)

gtk/src/callbacks.c

index 55b56fa431b7b65654932684b7a97c753a486215..d2e99f6cb2b52ee5142c474a679c38580c9438f4 100644 (file)
@@ -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