[gnome-documents] Use gtk_show_uri_on_window instead of deprecated gtk_show_uri



commit 60be7eaf678864a3ddefd52d88b9f6fde229e1a2
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 24 18:45:56 2017 +0100

    Use gtk_show_uri_on_window instead of deprecated gtk_show_uri
    
    Bump minimum GTK+ version to 3.22.10
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780507

 configure.ac       |    2 +-
 src/application.js |    6 +++---
 src/documents.js   |    4 ++--
 src/preview.js     |    2 +-
 src/selections.js  |    6 +++++-
 5 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f406b09..db0b9f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,7 +52,7 @@ AC_SUBST(LIBM)
 EVINCE_MIN_VERSION=3.13.3
 WEBKITGTK_MIN_VERSION=2.6.0
 GLIB_MIN_VERSION=2.39.3
-GTK_MIN_VERSION=3.19.1
+GTK_MIN_VERSION=3.22.10
 GOBJECT_INTROSPECTION_MIN_VERSION=1.31.6
 GDATA_MIN_VERSION=0.13.3
 GOA_MIN_VERSION=3.2.0
diff --git a/src/application.js b/src/application.js
index 9091162..e2d0ae4 100644
--- a/src/application.js
+++ b/src/application.js
@@ -194,9 +194,9 @@ const Application = new Lang.Class({
 
     _onActionHelp: function() {
         try {
-            Gtk.show_uri(this._mainWindow.get_screen(),
-                         'help:gnome-documents',
-                         Gtk.get_current_event_time());
+            Gtk.show_uri_on_window(this._mainWindow,
+                                   'help:gnome-documents',
+                                   Gtk.get_current_event_time());
         } catch (e) {
             logError(e, 'Unable to display help');
         }
diff --git a/src/documents.js b/src/documents.js
index ee5ed30..cb56c70 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -634,7 +634,7 @@ const DocCommon = new Lang.Class({
             }));
     },
 
-    open: function(screen, timestamp) {
+    open: function(parent, timestamp) {
         if (!this.defaultAppName)
             return;
 
@@ -644,7 +644,7 @@ const DocCommon = new Lang.Class({
             if (this.defaultApp)
                 this.defaultApp.launch_uris( [ this.uri ], null);
             else
-                Gtk.show_uri(screen, this.uri, timestamp);
+                Gtk.show_uri_on_window(parent, this.uri, timestamp);
         } catch (e) {
             logError(e, 'Unable to show URI ' + this.uri);
         }
diff --git a/src/preview.js b/src/preview.js
index e4ea4ce..e6628a3 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -112,7 +112,7 @@ const Preview = new Lang.Class({
     _openCurrent: function() {
         let doc = Application.documentManager.getActiveItem();
         if (doc)
-            doc.open(this.mainWindow.get_screen(), Gtk.get_current_event_time());
+            doc.open(this.mainWindow, Gtk.get_current_event_time());
     },
 
     vfunc_destroy: function() {
diff --git a/src/selections.js b/src/selections.js
index f00279c..f1f8bbe 100644
--- a/src/selections.js
+++ b/src/selections.js
@@ -992,7 +992,11 @@ const SelectionToolbar = new Lang.Class({
         selection.forEach(Lang.bind(this,
             function(urn) {
                 let doc = Application.documentManager.getItemById(urn);
-                doc.open(widget.get_screen(), Gtk.get_current_event_time());
+                let toplevel = this.get_toplevel();
+                if (!toplevel.is_toplevel())
+                    throw(new Error('Code should not be reached'));
+
+                doc.open(toplevel, Gtk.get_current_event_time());
             }));
     },
 


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