[Xfce4-commits] [apps/xfce4-terminal] 01/01: Resolve GTK+ 3.22 gtk_show_uri_on_window deprecation warning

noreply at xfce.org noreply at xfce.org
Tue Feb 28 11:35:37 CET 2017


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 098cb5d316939e0f1322aec59c77b52629a7e56b
Author: Igor <f2404 at yandex.ru>
Date:   Tue Feb 28 13:35:33 2017 +0300

    Resolve GTK+ 3.22 gtk_show_uri_on_window deprecation warning
---
 terminal/terminal-widget.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
index af7f3e4..3e7cebd 100644
--- a/terminal/terminal-widget.c
+++ b/terminal/terminal-widget.c
@@ -648,10 +648,10 @@ terminal_widget_open_uri (TerminalWidget *widget,
                           const gchar    *wlink,
                           gint            tag)
 {
-  GError      *error = NULL;
-  gchar       *uri;
-  guint        i;
-  GdkScreen   *screen;
+  GtkWindow *window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (widget)));
+  GError    *error = NULL;
+  gchar     *uri;
+  guint      i;
 
   for (i = 0; i < G_N_ELEMENTS (regex_patterns); i++)
     {
@@ -683,14 +683,17 @@ terminal_widget_open_uri (TerminalWidget *widget,
         }
 
       /* try to open the URI with the responsible application */
-      screen = gtk_widget_get_screen (GTK_WIDGET (widget));
-      if (!gtk_show_uri (screen, uri, gtk_get_current_event_time (), &error))
+#if GTK_CHECK_VERSION (3, 22, 0)
+      if (!gtk_show_uri_on_window (window, uri, gtk_get_current_event_time (), &error))
+#else
+      if (!gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (widget)),
+                         uri, gtk_get_current_event_time (), &error))
+#endif
         {
           /* escape ampersand symbols, etc. */
           uri = g_markup_escape_text (uri, -1);
           /* tell the user that we were unable to open the responsible application */
-          xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (widget))),
-                                  error, _("Failed to open the URL '%s'"), uri);
+          xfce_dialog_show_error (window, error, _("Failed to open the URL '%s'"), uri);
           g_error_free (error);
         }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list