From: Guido Günther Date: Tue, 11 Jan 2022 19:21:55 +0000 (+0100) Subject: wayland: xdg-activation: Don't assume there's a focus surface X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~3^2~6^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=108b7025dc814e70b98c98634aa3b9e7e77e3446;p=gtk4.git wayland: xdg-activation: Don't assume there's a focus surface Tools like gtk4-launch can't set surface on the activation token so don't require it. If the compositor requires it we can't do anything about it anyway. This avoids a critical: (gtk4-launch:23497): Gdk-CRITICAL **: 17:07:24.704: gdk_wayland_surface_get_wl_surface: assertion 'GDK_IS_WAYLAND_SURFACE (surface)' failed Fixes: be4216e051 ("gdk/wayland: Support the xdg-activation wayland protocol") Signed-off-by: Guido Günther --- diff --git a/gdk/wayland/gdkapplaunchcontext-wayland.c b/gdk/wayland/gdkapplaunchcontext-wayland.c index c9498e507c..c8bf5afd25 100644 --- a/gdk/wayland/gdkapplaunchcontext-wayland.c +++ b/gdk/wayland/gdkapplaunchcontext-wayland.c @@ -73,8 +73,9 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context xdg_activation_token_v1_set_serial (token, _gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL), gdk_wayland_seat_get_wl_seat (GDK_SEAT (seat))); - xdg_activation_token_v1_set_surface (token, - gdk_wayland_surface_get_wl_surface (focus_surface)); + if (focus_surface) + xdg_activation_token_v1_set_surface (token, + gdk_wayland_surface_get_wl_surface (focus_surface)); xdg_activation_token_v1_commit (token); while (app_launch_data.token == NULL)