From f1f410dcd25a44387b6a406076c64bcad2d9f02637c66e2b3d939f2d680a1e94 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Tue, 12 Sep 2023 08:22:03 +0000 Subject: [PATCH 1/2] Accepting request 1109867 from GNOME:Next Pushing GNOME 45.rc packages OBS-URL: https://build.opensuse.org/request/show/1109867 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/xdg-desktop-portal?expand=0&rev=70 --- ...-found-implementation-if-it-launched.patch | 305 ------------------ xdg-desktop-portal-1.16.0.tar.xz | 3 - xdg-desktop-portal-1.17.0.tar.xz | 3 + xdg-desktop-portal.changes | 34 ++ xdg-desktop-portal.spec | 21 +- 5 files changed, 44 insertions(+), 322 deletions(-) delete mode 100644 0001-portal-impl-Only-return-found-implementation-if-it-launched.patch delete mode 100644 xdg-desktop-portal-1.16.0.tar.xz create mode 100644 xdg-desktop-portal-1.17.0.tar.xz diff --git a/0001-portal-impl-Only-return-found-implementation-if-it-launched.patch b/0001-portal-impl-Only-return-found-implementation-if-it-launched.patch deleted file mode 100644 index 2f4d066..0000000 --- a/0001-portal-impl-Only-return-found-implementation-if-it-launched.patch +++ /dev/null @@ -1,305 +0,0 @@ -From bbcf5110d83147a552ad40841a733b49633e9208 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 13 Mar 2023 12:38:17 +0100 -Subject: [PATCH] portal-impl: Only return found implementation if it launched - -If no portal backend for a given interface is found, a fallback is -always tried anyway, despite that fallback not being listed as -compatible with the current desktop environment. - -Sometimes it's good that a fallback is returned; e.g. the -xdg-desktop-portal-gtk file chooser backend is technically usable -anywhere, however, some backends might be specifically designed to only -work in a specific desktop environment, e.g. xdg-desktop-portal-gnome. - -In order to avoid creating portals with non-functional backends, make -sure it's possible to create a proxy object for the interface and D-Bus -name, and that it launched successfully (i.e. has no name owner after -creating the proxy). ---- - src/portal-impl.c | 67 +++++++++++++++++++++++++++++++++++++--- - src/portal-impl.h | 5 ++- - src/xdg-desktop-portal.c | 51 ++++++++++++++++++++---------- - 3 files changed, 101 insertions(+), 22 deletions(-) - -diff --git a/src/portal-impl.c b/src/portal-impl.c -index a55ba9e55..0b535d1e0 100644 ---- a/src/portal-impl.c -+++ b/src/portal-impl.c -@@ -29,9 +29,12 @@ - #include - #include - -+#include "xdp-utils.h" -+ - static void - portal_implementation_free (PortalImplementation *impl) - { -+ g_clear_pointer (&impl->dummy_proxies, g_hash_table_unref); - g_free (impl->source); - g_free (impl->dbus_name); - g_strfreev (impl->interfaces); -@@ -55,6 +58,10 @@ register_portal (const char *path, gboolean opt_verbose, GError **error) - if (!g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, error)) - return FALSE; - -+ impl->dummy_proxies = g_hash_table_new_full (g_str_hash, -+ g_str_equal, -+ g_free, -+ g_object_unref); - impl->source = g_path_get_basename (path); - impl->dbus_name = g_key_file_get_string (keyfile, "portal", "DBusName", error); - if (impl->dbus_name == NULL) -@@ -198,8 +205,44 @@ load_installed_portals (gboolean opt_verbose) - implementations = g_list_sort (implementations, sort_impl_by_use_in_and_name); - } - -+static gboolean -+create_dummy_proxy (PortalImplementation *impl, -+ GDBusConnection *connection, -+ const char *interface, -+ GError **error) -+{ -+ g_autoptr(GDBusProxy) proxy = NULL; -+ -+ g_debug ("Creating dummy proxy for %s on %s", interface, impl->dbus_name); -+ proxy = g_dbus_proxy_new_sync (connection, -+ G_DBUS_PROXY_FLAGS_NONE, -+ NULL, -+ impl->dbus_name, -+ DESKTOP_PORTAL_OBJECT_PATH, -+ interface, -+ NULL, -+ error); -+ if (!proxy) -+ return FALSE; -+ -+ if (!g_dbus_proxy_get_name_owner (proxy)) -+ { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "Proxy has no owner"); -+ return FALSE; -+ } -+ -+ g_debug ("Dummy proxy created"); -+ -+ g_hash_table_insert (impl->dummy_proxies, -+ g_strdup (interface), -+ g_steal_pointer (&proxy)); -+ return TRUE; -+} -+ - PortalImplementation * --find_portal_implementation (const char *interface) -+find_portal_implementation (GDBusConnection *connection, -+ const char *interface) - { - const char *desktops_str = g_getenv ("XDG_CURRENT_DESKTOP"); - g_auto(GStrv) desktops = NULL; -@@ -216,15 +259,23 @@ find_portal_implementation (const char *interface) - for (l = implementations; l != NULL; l = l->next) - { - PortalImplementation *impl = l->data; -+ g_autoptr(GError) error = NULL; - - if (!g_strv_contains ((const char **)impl->interfaces, interface)) - continue; - -- if (g_strv_case_contains ((const char **)impl->use_in, desktops[i])) -+ if (!g_strv_case_contains ((const char **)impl->use_in, desktops[i])) -+ continue; -+ -+ if (!create_dummy_proxy (impl, connection, interface, &error)) - { -- g_debug ("Using %s for %s in %s", impl->source, interface, desktops[i]); -- return impl; -+ g_debug ("Failed to create dummy proxy on %s for %s: %s", -+ impl->dbus_name, interface, error->message); -+ continue; - } -+ -+ g_debug ("Using %s for %s in %s", impl->source, interface, desktops[i]); -+ return impl; - } - } - -@@ -232,10 +283,18 @@ find_portal_implementation (const char *interface) - for (l = implementations; l != NULL; l = l->next) - { - PortalImplementation *impl = l->data; -+ g_autoptr(GError) error = NULL; - - if (!g_strv_contains ((const char **)impl->interfaces, interface)) - continue; - -+ if (!create_dummy_proxy (impl, connection, interface, &error)) -+ { -+ g_debug ("Failed to create dummy fallback proxy on %s for %s: %s", -+ impl->dbus_name, interface, error->message); -+ continue; -+ } -+ - g_debug ("Falling back to %s for %s", impl->source, interface); - return impl; - } -diff --git a/src/portal-impl.h b/src/portal-impl.h -index a5d792d38..63705a7b3 100644 ---- a/src/portal-impl.h -+++ b/src/portal-impl.h -@@ -23,6 +23,7 @@ - #define __PORTAL_IMPL_H__ - - #include -+#include - - typedef struct { - char *source; -@@ -30,10 +31,12 @@ typedef struct { - char **interfaces; - char **use_in; - int priority; -+ GHashTable *dummy_proxies; - } PortalImplementation; - - void load_installed_portals (gboolean opt_verbose); --PortalImplementation *find_portal_implementation (const char *interface); -+PortalImplementation *find_portal_implementation (GDBusConnection *connection, -+ const char *interface); - GPtrArray *find_all_portal_implementations (const char *interface); - - #endif /* __PORTAL_IMPL_H__ */ -diff --git a/src/xdg-desktop-portal.c b/src/xdg-desktop-portal.c -index 065ce502c..04f4081ea 100644 ---- a/src/xdg-desktop-portal.c -+++ b/src/xdg-desktop-portal.c -@@ -237,7 +237,8 @@ on_bus_acquired (GDBusConnection *connection, - init_document_proxy (connection); - init_permission_store (connection); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.Lockdown"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Lockdown"); - if (implementation != NULL) - lockdown = xdp_dbus_impl_lockdown_proxy_new_sync (connection, - G_DBUS_PROXY_FLAGS_NONE, -@@ -259,40 +260,48 @@ on_bus_acquired (GDBusConnection *connection, - export_portal_implementation (connection, settings_create (connection, impls)); - g_ptr_array_free (impls, TRUE); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.FileChooser"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.FileChooser"); - if (implementation != NULL) - export_portal_implementation (connection, - file_chooser_create (connection, implementation->dbus_name, lockdown)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.AppChooser"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.AppChooser"); - if (implementation != NULL) - export_portal_implementation (connection, - open_uri_create (connection, implementation->dbus_name, lockdown)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.Print"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Print"); - if (implementation != NULL) - export_portal_implementation (connection, - print_create (connection, implementation->dbus_name, lockdown)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.Notification"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Notification"); - if (implementation != NULL) - export_portal_implementation (connection, - notification_create (connection, implementation->dbus_name)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.Inhibit"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Inhibit"); - if (implementation != NULL) - export_portal_implementation (connection, - inhibit_create (connection, implementation->dbus_name)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.Access"); -- implementation2 = find_portal_implementation ("org.freedesktop.impl.portal.Screenshot"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Access"); -+ implementation2 = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Screenshot"); - if (implementation != NULL && implementation2 != NULL) - export_portal_implementation (connection, - screenshot_create (connection, - implementation->dbus_name, - implementation2->dbus_name)); - -- implementation2 = find_portal_implementation ("org.freedesktop.impl.portal.Background"); -+ implementation2 = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Background"); - if (implementation != NULL) - { - export_portal_implementation (connection, -@@ -313,47 +322,55 @@ on_bus_acquired (GDBusConnection *connection, - implementation->dbus_name, - implementation2->dbus_name)); - -- implementation2 = find_portal_implementation ("org.freedesktop.impl.portal.Wallpaper"); -+ implementation2 = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Wallpaper"); - if (implementation != NULL && implementation2 != NULL) - export_portal_implementation (connection, - wallpaper_create (connection, - implementation->dbus_name, - implementation2->dbus_name)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.Account"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Account"); - if (implementation != NULL) - export_portal_implementation (connection, - account_create (connection, implementation->dbus_name)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.Email"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Email"); - if (implementation != NULL) - export_portal_implementation (connection, - email_create (connection, implementation->dbus_name)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.Secret"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.Secret"); - if (implementation != NULL) - export_portal_implementation (connection, - secret_create (connection, implementation->dbus_name)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.GlobalShortcuts"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.GlobalShortcuts"); - if (implementation != NULL) - export_portal_implementation (connection, - global_shortcuts_create (connection, implementation->dbus_name)); - - #ifdef HAVE_GLIB_2_66 -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.DynamicLauncher"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.DynamicLauncher"); - if (implementation != NULL) - export_portal_implementation (connection, - dynamic_launcher_create (connection, implementation->dbus_name)); - #endif - - #ifdef HAVE_PIPEWIRE -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.ScreenCast"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.ScreenCast"); - if (implementation != NULL) - export_portal_implementation (connection, - screen_cast_create (connection, implementation->dbus_name)); - -- implementation = find_portal_implementation ("org.freedesktop.impl.portal.RemoteDesktop"); -+ implementation = find_portal_implementation (connection, -+ "org.freedesktop.impl.portal.RemoteDesktop"); - if (implementation != NULL) - export_portal_implementation (connection, - remote_desktop_create (connection, implementation->dbus_name)); diff --git a/xdg-desktop-portal-1.16.0.tar.xz b/xdg-desktop-portal-1.16.0.tar.xz deleted file mode 100644 index 6b35cb8..0000000 --- a/xdg-desktop-portal-1.16.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5b41a5915c11851493d8c33b9783f147a0a6f419db80ad760e84cd3420fd8c19 -size 250524 diff --git a/xdg-desktop-portal-1.17.0.tar.xz b/xdg-desktop-portal-1.17.0.tar.xz new file mode 100644 index 0000000..bfa32fb --- /dev/null +++ b/xdg-desktop-portal-1.17.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cafa7c4289decf203d21829abbbefc3e968c9975664685e151db2c701b532a8b +size 258252 diff --git a/xdg-desktop-portal.changes b/xdg-desktop-portal.changes index 4427b5e..8859b3a 100644 --- a/xdg-desktop-portal.changes +++ b/xdg-desktop-portal.changes @@ -1,3 +1,37 @@ +------------------------------------------------------------------- +Wed Aug 9 10:53:54 UTC 2023 - Bjørn Lie + +- Update to version 1.17.0: + + Drop the Autotools build. Meson is now the only supported build + system. + + Rework how portal implementations are loaded. This new, more + robust system allows selecting specific backends for specific + portals, and layering them when necessary. Platforms that + provide portals implementation are encouraged to provide a + suitable configuration file. + + Introduce a new Clipboard portal. This portal extends the + Remote Desktop portal by adding support for sharing clipboard + between remote machines. + + Introduce a new Input Capture portal. This portal adds + mechanisms for taking control of input devices. The primary + usage model is centered around the InputLeap and Synergy use + cases, where local devices are used to control remote displays. + + Stop using the deprecated GTimeVal struct + + Bump GLib dependency to 2.66 + + Add an "accept-label" option the the Print portal. This lets + apps suggest a proper label to the print operation. + + Various fixes to the Global Shortcuts portal. + + Support restoring remote desktop sessions. + + Improve robustness of the OpenURI portal by validating more + URIs. + + The PipeWire dependency is now mandatory. + + Various improvements for the test suite. + + Updated translations. +- Drop 0001-portal-impl-Only-return-found-implementation-if-it-launched.patch + fixed upstream. +- Switch to meson buildsystem following upstream changes. Add meson + BuildRequires and macros. + ------------------------------------------------------------------- Fri Jun 23 09:54:14 UTC 2023 - Antonio Larrosa diff --git a/xdg-desktop-portal.spec b/xdg-desktop-portal.spec index 103b862..0418b79 100644 --- a/xdg-desktop-portal.spec +++ b/xdg-desktop-portal.spec @@ -17,17 +17,15 @@ Name: xdg-desktop-portal -Version: 1.16.0 +Version: 1.17.0 Release: 0 Summary: A portal frontend service for Flatpak License: LGPL-2.1-or-later Group: System/Libraries URL: https://github.com/flatpak/xdg-desktop-portal Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz -# PATCH-FIX-UPSTREAM -Patch0: 0001-portal-impl-Only-return-found-implementation-if-it-launched.patch -BuildRequires: libtool +BuildRequires: meson BuildRequires: pkgconfig BuildRequires: systemd-rpm-macros BuildRequires: xmlto @@ -75,18 +73,13 @@ This package contains convenience files for developers. %autosetup -p1 %build -export LANG=C.UTF-8 -autoreconf -fiv -%configure \ - --enable-geoclue \ - --enable-pipewire \ - --docdir=%{_defaultdocdir}/%{name} \ +%meson \ + -Dpytest=disabled \ %{nil} -%make_build +%meson_build %install -export LANG=C.UTF-8 -%make_install +%meson_install %find_lang %{name} %{?no_lang_C} %post @@ -115,7 +108,7 @@ export LANG=C.UTF-8 %{_userunitdir}/xdg-desktop-portal-rewrite-launchers.service %files devel -%doc %{_defaultdocdir}/%{name}/ +%doc %{_datadir}/doc/%{name}/ %{_datadir}/pkgconfig/%{name}.pc %files lang -f %{name}.lang From 02ab8da6dd2812281a4ba0bb00e53096538e4df9036549369e930ef799ff96f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Tue, 19 Sep 2023 08:51:46 +0000 Subject: [PATCH 2/2] Accepting request 1112076 from GNOME:Next OBS-URL: https://build.opensuse.org/request/show/1112076 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/xdg-desktop-portal?expand=0&rev=71 --- xdg-desktop-portal-1.17.0.tar.xz | 3 -- xdg-desktop-portal-1.18.0.tar.xz | 3 ++ xdg-desktop-portal.changes | 63 ++++++++++++++++++++++++++++++++ xdg-desktop-portal.spec | 4 +- 4 files changed, 69 insertions(+), 4 deletions(-) delete mode 100644 xdg-desktop-portal-1.17.0.tar.xz create mode 100644 xdg-desktop-portal-1.18.0.tar.xz diff --git a/xdg-desktop-portal-1.17.0.tar.xz b/xdg-desktop-portal-1.17.0.tar.xz deleted file mode 100644 index bfa32fb..0000000 --- a/xdg-desktop-portal-1.17.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cafa7c4289decf203d21829abbbefc3e968c9975664685e151db2c701b532a8b -size 258252 diff --git a/xdg-desktop-portal-1.18.0.tar.xz b/xdg-desktop-portal-1.18.0.tar.xz new file mode 100644 index 0000000..c2e15d6 --- /dev/null +++ b/xdg-desktop-portal-1.18.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ea35a6420a98b598c83355fc19feaea8ba999149641bf84079b0c572b00f5bd +size 260788 diff --git a/xdg-desktop-portal.changes b/xdg-desktop-portal.changes index 8859b3a..04ad6aa 100644 --- a/xdg-desktop-portal.changes +++ b/xdg-desktop-portal.changes @@ -1,3 +1,66 @@ +------------------------------------------------------------------- +Mon Sep 18 19:45:54 UTC 2023 - Bjørn Lie + +- Update to version 1.18.0: + + Highlights: + - A new config-based portal matching mechanism that gives + preciser control over which portal backends are picked for + each portal. + - New portals: Clipboard and Input Capture. + - The settings portal now documents an 'accent-color' key. + + New portal APIs: + - Introduce a new Clipboard portal. This portal extends the + Remote Desktop portal by adding support for sharing clipboard + between remote machines. + - Introduce a new Input Capture portal. This portal adds + mechanisms for taking control of input devices. The primary + usage model is centered around the InputLeap and Synergy use + cases, where local devices are used to control remote + displays. + - Add an "accept-label" option the the Print portal. This lets + apps suggest a proper label to the print operation. + - Document a new 'accent-color' key in the Settings portal. + This key represents an arbitrary color in sRGB colorspace. + How implementations of the portal provide this key is + entirely dependent on their internal policies and design. + - Support restoring remote desktop sessions. + - Introduce the ReadOne() method in the Settings portal. This + method is now preferred over the Read() method, as Read() + mistakenly returned a variant inside a variant. The Read() + method will continue to exist for compatibility with existing + apps, but its usage is deprecated. We recommend apps to port + to the ReadOne() method. Apps can decide whether to use + ReadOne() or Read() by looking at the version of the Settings + portal. + + Changes that might be relevant for distributors: + - Rework how portal implementations are loaded. This new, more + robust system allows selecting specific backends for specific + portals, and layering them when necessary. Platforms that + provide portals implementation are encouraged to provide a + suitable configuration file. + - Drop the Autotools build. Meson is now the only supported + build system. + - The PipeWire dependency is now mandatory. + - Bump GLib dependency to 2.66. + + Misc changes: + - Improve robustness of the OpenURI portal by validating more + URIs. + - Various small visual tweaks to the generated documentation. + - Various fixes to the Global Shortcuts portal. + - Stop using the deprecated GTimeVal struct. + - Document xdg-desktop-portal versioning scheme. + - Fix various issues in the OpenURI portal. + - Bump interface version of the Printer portal to 2. + - Validate addresses following the HTML specs in the Email + portal. + - Document minimum version of the new ReadOne() method of the + Settings portal. + - Add a mapping id property to the ScreenCast portal. + - Add activation token parameter to the Email portal. + - Test tarball generation in CI. + - Updated translations. +- Add docutils BuildRequires: New dependency. + ------------------------------------------------------------------- Wed Aug 9 10:53:54 UTC 2023 - Bjørn Lie diff --git a/xdg-desktop-portal.spec b/xdg-desktop-portal.spec index 0418b79..35e96b0 100644 --- a/xdg-desktop-portal.spec +++ b/xdg-desktop-portal.spec @@ -17,7 +17,7 @@ Name: xdg-desktop-portal -Version: 1.17.0 +Version: 1.18.0 Release: 0 Summary: A portal frontend service for Flatpak License: LGPL-2.1-or-later @@ -25,6 +25,7 @@ Group: System/Libraries URL: https://github.com/flatpak/xdg-desktop-portal Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz +BuildRequires: docutils BuildRequires: meson BuildRequires: pkgconfig BuildRequires: systemd-rpm-macros @@ -106,6 +107,7 @@ This package contains convenience files for developers. %{_userunitdir}/xdg-document-portal.service %{_userunitdir}/xdg-permission-store.service %{_userunitdir}/xdg-desktop-portal-rewrite-launchers.service +%{_mandir}/man5/portals.conf.5%{?ext_man} %files devel %doc %{_datadir}/doc/%{name}/