summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2019-01-23 17:02:01 +0100
committerCarlos Garnacho <carlosg@gnome.org>2019-01-23 19:13:37 +0100
commitbff46d8696568b51c2c31e9379ee3a7249388f59 (patch)
tree3e1172fa9090f76ccbc6ac22385f12e2c26668f1
parented9db5a17327e0e12036d9daa25f37252554419d (diff)
downloadgtk+-bff46d8696568b51c2c31e9379ee3a7249388f59.tar.gz
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
-rw-r--r--gdk/wayland/gdkapplaunchcontext-wayland.c15
1 files changed, 14 insertions, 1 deletions
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