Blame SOURCES/0001-gtk-Don-t-assume-all-GdkDisplays-are-GdkX11Displays-.patch

3a5fb7
From c0620e432650e81062c1967cc669829dbd29b310 Mon Sep 17 00:00:00 2001
3a5fb7
From: Michael Meeks <michael.meeks@suse.com>
3a5fb7
Date: Fri, 9 Nov 2012 16:16:40 +0000
3a5fb7
Subject: [PATCH] gtk: Don't assume all GdkDisplays are GdkX11Displays:
3a5fb7
 broadway/wayland
3a5fb7
3a5fb7
---
3a5fb7
 src/canberra-gtk-module.c | 15 +++++++++++++++
3a5fb7
 src/canberra-gtk.c        |  5 +++++
3a5fb7
 2 files changed, 20 insertions(+)
3a5fb7
3a5fb7
diff --git a/src/canberra-gtk-module.c b/src/canberra-gtk-module.c
3a5fb7
index 67791f0..c1532ab 100644
3a5fb7
--- a/src/canberra-gtk-module.c
3a5fb7
+++ b/src/canberra-gtk-module.c
3a5fb7
@@ -307,6 +307,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) {
3a5fb7
         guchar *data = NULL;
3a5fb7
         gint ret = -1;
3a5fb7
 
3a5fb7
+#ifdef GDK_IS_X11_DISPLAY
3a5fb7
+        if (!GDK_IS_X11_DISPLAY(d))
3a5fb7
+                return 0;
3a5fb7
+#endif
3a5fb7
+
3a5fb7
         if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w),
3a5fb7
                                gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"),
3a5fb7
                                0, G_MAXLONG, False, XA_CARDINAL, &type_return,
3a5fb7
@@ -335,6 +340,11 @@ static gint display_get_desktop(GdkDisplay *d) {
3a5fb7
         guchar *data = NULL;
3a5fb7
         gint ret = -1;
3a5fb7
 
3a5fb7
+#ifdef GDK_IS_X11_DISPLAY
3a5fb7
+        if (!GDK_IS_X11_DISPLAY(d))
3a5fb7
+                return 0;
3a5fb7
+#endif
3a5fb7
+
3a5fb7
         if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), DefaultRootWindow(GDK_DISPLAY_XDISPLAY(d)),
3a5fb7
                                gdk_x11_get_xatom_by_name_for_display(d, "_NET_CURRENT_DESKTOP"),
3a5fb7
                                0, G_MAXLONG, False, XA_CARDINAL, &type_return,
3a5fb7
@@ -365,6 +375,11 @@ static gboolean window_is_xembed(GdkDisplay *d, GdkWindow *w) {
3a5fb7
         gboolean ret = FALSE;
3a5fb7
         Atom xembed;
3a5fb7
 
3a5fb7
+#ifdef GDK_IS_X11_DISPLAY
3a5fb7
+        if (!GDK_IS_X11_DISPLAY(d))
3a5fb7
+                return FALSE;
3a5fb7
+#endif
3a5fb7
+
3a5fb7
         /* Gnome Panel applets are XEMBED windows. We need to make sure we
3a5fb7
          * ignore them */
3a5fb7
 
3a5fb7
diff --git a/src/canberra-gtk.c b/src/canberra-gtk.c
3a5fb7
index 34446f5..08cb668 100644
3a5fb7
--- a/src/canberra-gtk.c
3a5fb7
+++ b/src/canberra-gtk.c
3a5fb7
@@ -185,6 +185,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) {
3a5fb7
         guchar *data = NULL;
3a5fb7
         gint ret = -1;
3a5fb7
 
3a5fb7
+#ifdef GDK_IS_X11_DISPLAY
3a5fb7
+        if (!GDK_IS_X11_DISPLAY(d))
3a5fb7
+                return 0;
3a5fb7
+#endif
3a5fb7
+
3a5fb7
         if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w),
3a5fb7
                                gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"),
3a5fb7
                                0, G_MAXLONG, False, XA_CARDINAL, &type_return,
3a5fb7
-- 
3a5fb7
1.9.0
3a5fb7