From ff56029ccc2ebd55b992c60f4be2ab471ce9da35 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 22 Aug 2023 08:26:22 -0400 Subject: [PATCH] wayland: Don't assume the shell protocol The gtk_shell proxy will be NULL if the compositor is not gnome-shell. Handle that without crashing. Fixes: #6048 --- gdk/wayland/gdkapplaunchcontext-wayland.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdk/wayland/gdkapplaunchcontext-wayland.c b/gdk/wayland/gdkapplaunchcontext-wayland.c index 176bfc8942..75742dd8e5 100644 --- a/gdk/wayland/gdkapplaunchcontext-wayland.c +++ b/gdk/wayland/gdkapplaunchcontext-wayland.c @@ -93,7 +93,8 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context id = app_launch_data.token; wl_event_queue_destroy (event_queue); } - else if (gtk_shell1_get_version (display->gtk_shell) >= GTK_SHELL1_NOTIFY_LAUNCH_SINCE_VERSION) + else if (display->gtk_shell && + gtk_shell1_get_version (display->gtk_shell) >= GTK_SHELL1_NOTIFY_LAUNCH_SINCE_VERSION) { id = g_uuid_string_random (); gtk_shell1_notify_launch (display->gtk_shell, id); -- 2.30.2