[polari] utils: Don't use Gtk.show_uri()



commit f9298deec3bcfdbcd9cc836caeca23d110f2b5f2
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jul 8 01:48:20 2021 +0200

    utils: Don't use Gtk.show_uri()
    
    It is deprecated in favor of Gtk.show_uri_on_window(), which covers
    both the window and window-less case.
    
    https://gitlab.gnome.org/GNOME/polari/-/merge_requests/199

 src/utils.js | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/src/utils.js b/src/utils.js
index bbbb646c..1b96384f 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -40,7 +40,6 @@ export {
     formatTimePassed
 };
 
-import Gdk from 'gi://Gdk';
 import Gio from 'gi://Gio';
 import GLib from 'gi://GLib';
 import Gtk from 'gi://Gtk';
@@ -252,10 +251,7 @@ function findChannels(str, server) {
 function openURL(url, timestamp) {
     let app = Gio.Application.get_default();
     try {
-        if (app.active_window)
-            Gtk.show_uri_on_window(app.active_window, url, timestamp);
-        else
-            Gtk.show_uri(Gdk.Screen.get_default(), url, timestamp);
+        Gtk.show_uri_on_window(app.active_window, url, timestamp);
     } catch (e) {
         let n = new AppNotifications.SimpleOutput(_('Failed to open link'));
         app.notificationQueue.addNotification(n);


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