[gtk/wip/carlosg/present-window-on-wayland: 3/3] gdk/wayland: Set a startup notification



commit bff46d8696568b51c2c31e9379ee3a7249388f59
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jan 23 17:02:01 2019 +0100

    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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]