From bff46d8696568b51c2c31e9379ee3a7249388f59 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 23 Jan 2019 17:02:01 +0100 Subject: [PATCH] gdk/wayland: Set a startup notification And notify the shell about it. This is done through the gtk_shell1.notify_launch request added in gtk-shell v3. All the plumbing on the way to the activated application is already in place to transfer the startup ID, so the other side just has to reply with gtk_surface1.request_focus. Closes: https://gitlab.gnome.org/GNOME/gtk/issues/624 --- gdk/wayland/gdkapplaunchcontext-wayland.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gdk/wayland/gdkapplaunchcontext-wayland.c b/gdk/wayland/gdkapplaunchcontext-wayland.c index b69cc31fce..f18c13e6b4 100644 --- a/gdk/wayland/gdkapplaunchcontext-wayland.c +++ b/gdk/wayland/gdkapplaunchcontext-wayland.c @@ -35,7 +35,20 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context GAppInfo *info, GList *files) { - return NULL; + GdkWaylandDisplay *display; + gchar *id = NULL; + + g_object_get (context, "display", &display, NULL); + + if (display->gtk_shell_version >= 3) + { + id = g_uuid_string_random (); + gtk_shell1_notify_launch (display->gtk_shell, id); + } + + g_object_unref (display); + + return id; } static void