From 4557ec8fb762ee7f21fcb1dfad75687bc29272f6 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Sat, 11 May 2024 11:16:42 +0900 Subject: [PATCH] Replace Gtk.show_uri with Gtk.UriLauncher --- README.md | 8 ++++---- meson.build | 2 +- src/MainWindow.vala | 12 ++++++++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b8c10bca..29192d2c 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ GitHub Issue Reporter ## Building, Testing, and Installation You'll need the following dependencies: -* libappstream-dev -* libgranite-7-dev -* libgtk-4-dev -* libadwaita-1-dev +* libappstream-dev (>=0.12.10) +* libgranite-7-dev (>=7.0.0) +* libgtk-4-dev (>=4.10) +* libadwaita-1-dev (>=1.0.0) * meson * valac diff --git a/meson.build b/meson.build index 395e8162..4d092307 100644 --- a/meson.build +++ b/meson.build @@ -40,7 +40,7 @@ executable( dependency('glib-2.0'), dependency('gobject-2.0'), dependency('granite-7', version: '>=7.0.0'), - dependency('gtk4'), + dependency('gtk4', version: '>= 4.10'), dependency('libadwaita-1', version: '>=1.0.0') ], install : true diff --git a/src/MainWindow.vala b/src/MainWindow.vala index b6ba9fce..bdc63ff5 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -356,8 +356,16 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { } private void launch_from_row (RepoRow row) { - Gtk.show_uri (null, row.url, Gdk.CURRENT_TIME); - close (); + var uri_launcher = new Gtk.UriLauncher (row.url); + uri_launcher.launch.begin (null, null, (obj, res) => { + try { + uri_launcher.launch.end (res); + } catch (Error err) { + warning ("Failed to launch \"%s\": %s", row.url, err.message); + } + + close (); + }); } private async GenericArray get_compulsory_for_desktop (AppStream.Pool appstream_pool) {