[gtk+] GtkApplicationX11: read the startup ID from the platform data



commit cecb2fa3ca54bff6e262438724afc46e94fab484
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Jan 1 16:53:31 2014 +0100

    GtkApplicationX11: read the startup ID from the platform data
    
    If the platform data passed with actions and activations includes
    a startup notify ID, we should read it and pass it down to GDK.
    This ensures that the right startup notify is completed after the
    signal emission, and that the user time of the GdkDisplay is properly
    updated (which in turn makes sure the windows are not subjected
    to focus-stealing-prevention)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721304

 gtk/gtkapplication-x11.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkapplication-x11.c b/gtk/gtkapplication-x11.c
index 1bd3f29..4ee5b8f 100644
--- a/gtk/gtkapplication-x11.c
+++ b/gtk/gtkapplication-x11.c
@@ -79,6 +79,20 @@ gtk_application_impl_x11_init (GtkApplicationImplX11 *x11)
 }
 
 static void
+gtk_application_impl_x11_before_emit (GtkApplicationImpl *impl,
+                                      GVariant           *platform_data)
+{
+  const char *startup_notification_id;
+
+  if (g_variant_lookup (platform_data, "desktop-startup-id",
+                        "&s", &startup_notification_id))
+    {
+      gdk_x11_display_set_startup_notification_id (gdk_display_get_default (),
+                                                   startup_notification_id);
+    }
+}
+
+static void
 gtk_application_impl_x11_class_init (GtkApplicationImplX11Class *class)
 {
   GtkApplicationImplDBusClass *dbus_class = GTK_APPLICATION_IMPL_DBUS_CLASS (class);
@@ -86,4 +100,5 @@ gtk_application_impl_x11_class_init (GtkApplicationImplX11Class *class)
 
   impl_class->handle_window_realize = gtk_application_impl_x11_handle_window_realize;
   dbus_class->get_window_system_id = gtk_application_impl_x11_get_window_system_id;
+  impl_class->before_emit = gtk_application_impl_x11_before_emit;
 }


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