From 89cbf708d7ce49e65eb2326b799bd17237a214d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 26 Nov 2025 10:46:14 +0100 Subject: [PATCH] Allow to get startup notify ID without GAppInfo Newer gnome-shell/portals versions rely on this. Resolves: https://issues.redhat.com/browse/RHEL-131154 --- ...iving-no-GAppInfo-for-getting-startu.patch | 56 +++++++++++++++++++ glib2.spec | 3 + 2 files changed, 59 insertions(+) create mode 100644 0001-gappinfo-Allow-giving-no-GAppInfo-for-getting-startu.patch diff --git a/0001-gappinfo-Allow-giving-no-GAppInfo-for-getting-startu.patch b/0001-gappinfo-Allow-giving-no-GAppInfo-for-getting-startu.patch new file mode 100644 index 0000000..8d1b1f4 --- /dev/null +++ b/0001-gappinfo-Allow-giving-no-GAppInfo-for-getting-startu.patch @@ -0,0 +1,56 @@ +From 373dfac8dbd9ed5e7ee398ae8645a4cd440163b4 Mon Sep 17 00:00:00 2001 +From: Julian Sparber +Date: Mon, 22 Jul 2024 14:24:22 +0200 +Subject: [PATCH] gappinfo: Allow giving no GAppInfo for getting startup notify + id + +On Wayland the activation token returned by +`g_app_launch_context_get_startup_notify_id()` doesn't depend on the +`GAppInfo`. The token is only used to hand over focus to the +application that is launched. In some cases it's not even possible to know +what application will actually be used to open the files. For example +when using portals within a sandbox. Therefore, allow providing no +`GAppInfo`. + +This also makes clear in the docs that the `files` argument can be `NULL`. + +(cherry picked from commit 6210708f050d389e83d921b9e5c09db1a988d510) +--- + gio/gappinfo.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/gio/gappinfo.c b/gio/gappinfo.c +index 652cae6e1..76b43d159 100644 +--- a/gio/gappinfo.c ++++ b/gio/gappinfo.c +@@ -1593,8 +1593,8 @@ g_app_launch_context_get_display (GAppLaunchContext *context, + /** + * g_app_launch_context_get_startup_notify_id: + * @context: a #GAppLaunchContext +- * @info: a #GAppInfo +- * @files: (element-type GFile): a #GList of #GFile objects ++ * @info: (nullable): the app info ++ * @files: (nullable) (element-type GFile): a list of [iface@Gio.File] objects + * + * Initiates startup notification for the application and returns the + * `XDG_ACTIVATION_TOKEN` or `DESKTOP_STARTUP_ID` for the launched operation, +@@ -1609,6 +1609,7 @@ g_app_launch_context_get_display (GAppLaunchContext *context, + * [freedesktop.org Startup Notification Protocol](http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt). + * + * Support for the XDG Activation Protocol was added in GLib 2.76. ++ * Since GLib 2.82 @info and @files can be `NULL`, but if it's not supported the returned token may be `NULL`. + * + * Returns: (nullable): a startup notification ID for the application, or %NULL if + * not supported. +@@ -1621,7 +1622,7 @@ g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context, + GAppLaunchContextClass *class; + + g_return_val_if_fail (G_IS_APP_LAUNCH_CONTEXT (context), NULL); +- g_return_val_if_fail (G_IS_APP_INFO (info), NULL); ++ g_return_val_if_fail (info == NULL || G_IS_APP_INFO (info), NULL); + + class = G_APP_LAUNCH_CONTEXT_GET_CLASS (context); + +-- +2.52.0 + diff --git a/glib2.spec b/glib2.spec index 7141b16..3bdb312 100644 --- a/glib2.spec +++ b/glib2.spec @@ -31,6 +31,9 @@ Patch: CVE-2025-4373.patch # https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4470 Patch: RHEL-114857.patch +# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3933 +Patch: 0001-gappinfo-Allow-giving-no-GAppInfo-for-getting-startu.patch + BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gettext