diff --git a/.gitignore b/.gitignore index 66eb7c3..b57391d 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ /xdg-desktop-portal-1.8.1.tar.xz /xdg-desktop-portal-1.10.0.tar.xz /xdg-desktop-portal-1.10.1.tar.xz +/xdg-desktop-portal-1.12.0.tar.xz diff --git a/open-uri-Avoid-calling-into-o.fd.FileManager1-during-startup.patch b/open-uri-Avoid-calling-into-o.fd.FileManager1-during-startup.patch deleted file mode 100644 index 5df3d1b..0000000 --- a/open-uri-Avoid-calling-into-o.fd.FileManager1-during-startup.patch +++ /dev/null @@ -1,115 +0,0 @@ -From d7622e15ff8fef114a6759dde564826d04215a9f Mon Sep 17 00:00:00 2001 -From: Simon McVittie -Date: Thu, 30 Sep 2021 12:00:51 +0100 -Subject: [PATCH] open-uri: Avoid calling into o.fd.FileManager1 during startup - -Making a synchronous call into a GTK implementation of o.fd.FileManager1 -can cause a deadlock, because GtkApplication makes a synchronous call -into the Inhibit portal when started in a non-GNOME, non-XFCE environment. -In this situation, each service does not take its bus name (and hence -complete service-activation) until it gets a reply from the other, which -obviously can't work. - -We don't actually need a GDBusProxy here: we don't need to subscribe to -any signals, watch any properties or hold any state, so it's just as -straightforward to use g_dbus_connection_call_sync() on a just-in-time -basis. - -The indentation is deliberately a bit odd here, to avoid a large -diffstat from re-indentation; it will be fixed in a subsequent commit. - -Fixes: 69961f3f "openuri: Use FileManager1 in OpenDirectory" -Resolves: https://github.com/flatpak/xdg-desktop-portal/issues/636 -Signed-off-by: Simon McVittie ---- - src/open-uri.c | 50 ++++++++++++++++++++++++-------------------------- - 1 file changed, 24 insertions(+), 26 deletions(-) - -diff --git a/src/open-uri.c b/src/open-uri.c -index bc53dbf..5c70715 100644 ---- a/src/open-uri.c -+++ b/src/open-uri.c -@@ -60,8 +60,6 @@ typedef struct _OpenURIClass OpenURIClass; - struct _OpenURI - { - XdpOpenURISkeleton parent_instance; -- -- GDBusProxy* file_manager; - }; - - struct _OpenURIClass -@@ -689,7 +687,6 @@ handle_open_in_thread_func (GTask *task, - { - g_autofree char *real_path = get_real_path_for_doc_path (path, app_id); - -- if (open_uri->file_manager != NULL) - { - /* Try opening the directory via the file manager interface, then - fall back to a plain URI open */ -@@ -697,21 +694,36 @@ handle_open_in_thread_func (GTask *task, - g_autoptr(GVariant) result = NULL; - g_autoptr(GVariantBuilder) uris_builder = NULL; - g_autofree char* item_uri = g_filename_to_uri (real_path, NULL, NULL); -+ g_autoptr(GDBusConnection) bus = NULL; -+ -+ bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &local_error); - - uris_builder = g_variant_builder_new (G_VARIANT_TYPE ("as")); - g_variant_builder_add (uris_builder, "s", item_uri); - -- result = g_dbus_proxy_call_sync (open_uri->file_manager, -- FILE_MANAGER_SHOW_ITEMS, -- g_variant_new ("(ass)", uris_builder, ""), -- G_DBUS_CALL_FLAGS_NONE, -- -1, -- NULL, -- &local_error); -+ if (bus) -+ result = g_dbus_connection_call_sync (bus, -+ FILE_MANAGER_DBUS_NAME, -+ FILE_MANAGER_DBUS_PATH, -+ FILE_MANAGER_DBUS_IFACE, -+ FILE_MANAGER_SHOW_ITEMS, -+ g_variant_new ("(ass)", uris_builder, ""), -+ NULL, /* ignore returned type */ -+ G_DBUS_CALL_FLAGS_NONE, -+ -1, -+ NULL, -+ &local_error); -+ - if (result == NULL) - { -- g_warning ("Failed to call " FILE_MANAGER_SHOW_ITEMS ": %s", -- local_error->message); -+ if (g_error_matches (local_error, G_DBUS_ERROR, -+ G_DBUS_ERROR_NAME_HAS_NO_OWNER) || -+ g_error_matches (local_error, G_DBUS_ERROR, -+ G_DBUS_ERROR_SERVICE_UNKNOWN)) -+ g_debug ("No " FILE_MANAGER_DBUS_NAME " available"); -+ else -+ g_warning ("Failed to call " FILE_MANAGER_SHOW_ITEMS ": %s", -+ local_error->message); - } - else - { -@@ -1079,20 +1091,6 @@ open_uri_create (GDBusConnection *connection, - g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (impl), G_MAXINT); - - open_uri = g_object_new (open_uri_get_type (), NULL); -- open_uri->file_manager = g_dbus_proxy_new_sync (connection, -- G_DBUS_PROXY_FLAGS_NONE, -- NULL, -- FILE_MANAGER_DBUS_NAME, -- FILE_MANAGER_DBUS_PATH, -- FILE_MANAGER_DBUS_IFACE, -- NULL, -- &error); -- if (!open_uri->file_manager) -- { -- g_debug ("Failed to create FileManager proxy: %s", error->message); -- // Missing FileManager1 errors should be non-fatal. -- g_clear_error (&error); -- } - - monitor = g_app_info_monitor_get (); - diff --git a/sources b/sources index 89675f6..a37f215 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xdg-desktop-portal-1.10.1.tar.xz) = 5db0bd866674ff016d864646ea7f91f09a1b8fbc5ec735e4c97165af71770d2c7d3333e771062644dd522b32f67ead72bc7ef99186e3b069671c174d4d601fdc +SHA512 (xdg-desktop-portal-1.12.0.tar.xz) = e422c2e84de067664788d6a84c11f318007c702b6ba3eaf47e11eb12b4493ae422b6b0a57f45734f8bfab8c8f2a776c82391a93667905a8f48abac03b5493994 diff --git a/xdg-desktop-portal.spec b/xdg-desktop-portal.spec index 4d7bfc1..3926c59 100644 --- a/xdg-desktop-portal.spec +++ b/xdg-desktop-portal.spec @@ -4,18 +4,17 @@ %global low_memory_monitor_version 2.0 Name: xdg-desktop-portal -Version: 1.10.1 -Release: 2%{?dist} +Version: 1.12.0 +Release: 1%{?dist} Summary: Portal frontend service to flatpak License: LGPLv2+ URL: https://github.com/flatpak/xdg-desktop-portal/ Source0: https://github.com/flatpak/xdg-desktop-portal/releases/download/%{version}/%{name}-%{version}.tar.xz -Patch0: %{url}/commit/d7622e15ff8fef114a6759dde564826d04215a9f.patch#/open-uri-Avoid-calling-into-o.fd.FileManager1-during-startup.patch - -BuildRequires: make BuildRequires: gcc +BuildRequires: make +BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(flatpak) BuildRequires: pkgconfig(fuse) BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib_version} @@ -23,8 +22,6 @@ BuildRequires: pkgconfig(json-glib-1.0) BuildRequires: pkgconfig(libgeoclue-2.0) >= %{geoclue_version} BuildRequires: pkgconfig(libpipewire-0.3) >= %{pipewire_version} BuildRequires: /usr/bin/xmlto -%{?systemd_requires} -BuildRequires: systemd Requires: dbus # Required version for icon validator. @@ -104,6 +101,9 @@ install -dm 755 %{buildroot}/%{_datadir}/%{name}/portals %changelog +* Tue Dec 21 2021 David King - 1.12.0-1 +- Update to 1.12.0 + * Tue Nov 09 2021 Aleksei Bavshin - 1.10.1-2 - Add patch for org.freedesktop.FileManager1 deadlock (#2020371)