From: Carlos Garnacho Date: Tue, 3 Jan 2023 12:44:44 +0000 (+0100) Subject: gdk/wayland: Perform xdg_activation on gdk_toplevel_set_startup_id X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~8^2~106^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5aeabdb3d404579b5cab4fff1642ed116f745a8b;p=gtk4.git gdk/wayland: Perform xdg_activation on gdk_toplevel_set_startup_id This call has everything to perform activation as specified by the xdg_activation protocol, notably a surface to activate as opposed to gdk_display_notify_startup_complete(). Make activation happen here, so that the surface gets activated when its gets a startup ID assigned. --- diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 0e0a651ead..1f5c2385d7 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -3871,6 +3871,25 @@ static void gdk_wayland_surface_set_startup_id (GdkSurface *surface, const char *startup_id) { + GdkWaylandSurface *wayland_surface = GDK_WAYLAND_SURFACE (surface); + GdkDisplay *display = gdk_surface_get_display (surface); + GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); + gchar *free_me = NULL; + + if (!startup_id) + { + free_me = g_steal_pointer (&display_wayland->startup_notification_id); + startup_id = free_me; + } + + if (startup_id) + { + xdg_activation_v1_activate (display_wayland->xdg_activation, + startup_id, + wayland_surface->display_server.wl_surface); + } + + g_free (free_me); } static gboolean