[gnome-dictionary] Use gtk_show_uri_on_window() with newer GTK+



commit 1163ed404c64ac2cecf082f2034442a352d69e0f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Mar 6 17:54:11 2017 +0000

    Use gtk_show_uri_on_window() with newer GTK+
    
    The gtk_show_uri() function won't work correctly inside a sandbox, and
    has been deprecated in GTK+ 3.22.

 src/gdict-app.c           |    9 +++++++++
 src/gdict-source-dialog.c |    7 +++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/gdict-app.c b/src/gdict-app.c
index e8a6a93..eed2994 100644
--- a/src/gdict-app.c
+++ b/src/gdict-app.c
@@ -121,9 +121,18 @@ gdict_app_cmd_help (GSimpleAction *action,
   g_return_if_fail (GTK_IS_APPLICATION (app));
 
   window = GDICT_WINDOW (gtk_application_get_windows (app)->data);
+
+#if GTK_CHECK_VERSION (3, 22, 0)
+  gtk_show_uri_on_window (GTK_WINDOW (window),
+                          "help:gnome-dictionary",
+                          gtk_get_current_event_time (),
+                          &err);
+#else
   gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)),
                 "help:gnome-dictionary",
                 gtk_get_current_event_time (), &err);
+#endif
+
   if (err)
     {
       gdict_show_gerror_dialog (GTK_WINDOW (window),
diff --git a/src/gdict-source-dialog.c b/src/gdict-source-dialog.c
index 10cf0f9..0a01fa6 100644
--- a/src/gdict-source-dialog.c
+++ b/src/gdict-source-dialog.c
@@ -443,9 +443,16 @@ on_dialog_response (GtkDialog *dialog,
       break;
 
     case GTK_RESPONSE_HELP:
+#if GTK_CHECK_VERSION (3, 22, 0)
+      gtk_show_uri_on_window (GTK_WINDOW (dialog),
+                              "help:gnome-dictionary/gnome-dictionary-add-source",
+                              gtk_get_current_event_time (), &err);
+#else
       gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (dialog)),
                     "help:gnome-dictionary/gnome-dictionary-add-source",
                     gtk_get_current_event_time (), &err);
+#endif
+
       if (err)
         {
           gdict_show_gerror_dialog (GTK_WINDOW (dialog),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]