[gnome-software] Add wayland startup notification support



commit 434d77722ac2c8847e0ada32f10848b5e55c15ee
Author: Kalev Lember <klember redhat com>
Date:   Sat Nov 26 11:24:46 2016 +0100

    Add wayland startup notification support
    
    ... so that the shell can correctly move the codecs search window in
    front of other windows after clicking the codec search notification.

 src/gs-application.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 29bae74..f779d6f 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -32,7 +32,12 @@
 #include <libsoup/soup.h>
 
 #ifdef GDK_WINDOWING_X11
-#include <gtk/gtkx.h>
+#include <gdk/gdkx.h>
+#endif
+#ifdef GDK_WINDOWING_WAYLAND
+#if GTK_CHECK_VERSION(3,22,4)
+#include <gdk/gdkwayland.h>
+#endif
 #endif
 
 #include "gd-notification.h"
@@ -646,24 +651,30 @@ install_resources_activated (GSimpleAction *action,
                              gpointer       data)
 {
        GsApplication *app = GS_APPLICATION (data);
-#ifdef GDK_WINDOWING_X11
        GdkDisplay *display;
-#endif
        const gchar *mode;
        const gchar *startup_id;
        g_autofree gchar **resources = NULL;
 
        g_variant_get (parameter, "(&s^a&s&s)", &mode, &resources, &startup_id);
 
-#ifdef GDK_WINDOWING_X11
        display = gdk_display_get_default ();
-
+#ifdef GDK_WINDOWING_X11
        if (GDK_IS_X11_DISPLAY (display)) {
                if (startup_id != NULL && startup_id[0] != '\0')
                        gdk_x11_display_set_startup_notification_id (display,
                                                                     startup_id);
        }
 #endif
+#ifdef GDK_WINDOWING_WAYLAND
+#if GTK_CHECK_VERSION(3,22,4)
+       if (GDK_IS_WAYLAND_DISPLAY (display)) {
+               if (startup_id != NULL && startup_id[0] != '\0')
+                       gdk_wayland_display_set_startup_notification_id (display,
+                                                                        startup_id);
+       }
+#endif
+#endif
 
        initialize_ui_and_present_window (app);
 


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