wayland: Don't assume the shell protocol
authorMatthias Clasen <mclasen@redhat.com>
Tue, 22 Aug 2023 12:26:22 +0000 (08:26 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 24 Aug 2023 14:27:02 +0000 (10:27 -0400)
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

index 176bfc8942fe75ec70390138e9a53ec07ff3f98d..75742dd8e5db0a8a7021d91f30afa2f69ee59c05 100644 (file)
@@ -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);