f73620
From 4ed430b4ef3013c96fa56cdc57b925b42d20ead9 Mon Sep 17 00:00:00 2001
f73620
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
f73620
Date: Thu, 20 Oct 2016 18:00:04 +0200
f73620
Subject: [PATCH] gtk-shell: Work around non-working startup notifications
f73620
f73620
GNOME Shell relies on the MetaScreen::startup-sequence-changed signal,
f73620
which is tied to (lib)startup-notification and therefore X11. As a result,
f73620
when we remove the startup sequence of a wayland client, GNOME Shell will
f73620
not be notified about this until startup-notification's timeout is hit.
f73620
As a temporary stop-gap, go through XWayland even for wayland clients,
f73620
so that the signal is emitted when expected.
f73620
f73620
https://bugzilla.gnome.org/show_bug.cgi?id=768531
f73620
---
f73620
 src/wayland/meta-wayland-gtk-shell.c | 10 ++++++++++
f73620
 1 file changed, 10 insertions(+)
f73620
f73620
diff --git a/src/wayland/meta-wayland-gtk-shell.c b/src/wayland/meta-wayland-gtk-shell.c
f73620
index d6e249f..9d1a19e 100644
f73620
--- a/src/wayland/meta-wayland-gtk-shell.c
f73620
+++ b/src/wayland/meta-wayland-gtk-shell.c
f73620
@@ -219,11 +219,21 @@ gtk_shell_set_startup_id (struct wl_client   *client,
f73620
                           struct wl_resource *resource,
f73620
                           const char         *startup_id)
f73620
 {
f73620
+#if 0
f73620
   MetaDisplay *display;
f73620
 
f73620
   display = meta_get_display ();
f73620
   meta_startup_notification_remove_sequence (display->startup_notification,
f73620
                                              startup_id);
f73620
+#else
f73620
+  /* HACK: MetaScreen::startup-sequence-changed is currently tied to
f73620
+           (lib)startup-notification, which means it only works on X11;
f73620
+           so for now, always go through XWayland, even for wayland clients */
f73620
+  gdk_x11_display_broadcast_startup_message (gdk_display_get_default (),
f73620
+                                             "remove",
f73620
+                                             "ID", startup_id,
f73620
+                                             NULL);
f73620
+#endif
f73620
 }
f73620
 
f73620
 static void
f73620
-- 
f73620
2.9.3