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