File 4705.patch of Package mutter

From 17d805cbffe257f66cef4a82ac990b1fa4db5f37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Tue, 7 Oct 2025 16:40:42 +0200
Subject: [PATCH] core/launch-context: Implement get_startup_notify_id with
 nullable AppInfo

As per GNOME/glib@6210708f the get_startup_notify_id vfunc has a
nullable appId parameter, this is because the value is irrelevant in a
wayland and XDG activation token world.

However, mutter still tries to use StartupNotification protocol if
possible and this is causing now a crash when activating a notification
since GNOME/gnome-shell@f85ee952.

So, if no appId is provided, let's just ignore the StartupNotification
protocol (that requires information such as the program name or
executable), otherwise we can just use the XDG Token and ignore the name
parameter that is currently unused
---
 src/core/meta-launch-context.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/meta-launch-context.c b/src/core/meta-launch-context.c
index 9d4b51efff8..d3d2554625c 100644
--- a/src/core/meta-launch-context.c
+++ b/src/core/meta-launch-context.c
@@ -139,7 +139,7 @@ meta_launch_context_get_startup_notify_id (GAppLaunchContext *launch_context,
     workspace_idx = meta_workspace_index (context->workspace);
 
 #ifdef HAVE_X11_CLIENT
-  if (display->x11_display)
+  if (display->x11_display && info)
     {
       /* If there is a X11 display, we prefer going entirely through
        * libsn, as SnMonitor expects to keep a view of the full lifetime
@@ -176,7 +176,7 @@ meta_launch_context_get_startup_notify_id (GAppLaunchContext *launch_context,
                           "display", context->display,
                           "id", startup_id,
                           "application-id", application_id,
-                          "name", g_app_info_get_name (info),
+                          "name", info ? g_app_info_get_name (info) : NULL,
                           "workspace", workspace_idx,
                           "timestamp", (uint64_t) context->timestamp,
                           NULL);
-- 
GitLab

openSUSE Build Service is sponsored by