1 From c0620e432650e81062c1967cc669829dbd29b310 Mon Sep 17 00:00:00 2001
2 From: Michael Meeks <michael.meeks@suse.com>
3 Date: Fri, 9 Nov 2012 16:16:40 +0000
4 Subject: [PATCH] gtk: Don't assume all GdkDisplays are GdkX11Displays:
5 broadway/wayland
6
7 ---
8 src/canberra-gtk-module.c | 15 +++++++++++++++
9 src/canberra-gtk.c | 5 +++++
10 2 files changed, 20 insertions(+), 0 deletions(-)
11
12 diff --git a/src/canberra-gtk-module.c b/src/canberra-gtk-module.c
13 index 67791f0..c1532ab 100644
14 --- a/src/canberra-gtk-module.c
15 +++ b/src/canberra-gtk-module.c
16 @@ -307,6 +307,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) {
17 guchar *data = NULL;
18 gint ret = -1;
19
20 +#ifdef GDK_IS_X11_DISPLAY
21 + if (!GDK_IS_X11_DISPLAY(d))
22 + return 0;
23 +#endif
24 +
25 if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w),
26 gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"),
27 0, G_MAXLONG, False, XA_CARDINAL, &type_return,
28 @@ -335,6 +340,11 @@ static gint display_get_desktop(GdkDisplay *d) {
29 guchar *data = NULL;
30 gint ret = -1;
31
32 +#ifdef GDK_IS_X11_DISPLAY
33 + if (!GDK_IS_X11_DISPLAY(d))
34 + return 0;
35 +#endif
36 +
37 if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), DefaultRootWindow(GDK_DISPLAY_XDISPLAY(d)),
38 gdk_x11_get_xatom_by_name_for_display(d, "_NET_CURRENT_DESKTOP"),
39 0, G_MAXLONG, False, XA_CARDINAL, &type_return,
40 @@ -365,6 +375,11 @@ static gboolean window_is_xembed(GdkDisplay *d, GdkWindow *w) {
41 gboolean ret = FALSE;
42 Atom xembed;
43
44 +#ifdef GDK_IS_X11_DISPLAY
45 + if (!GDK_IS_X11_DISPLAY(d))
46 + return FALSE;
47 +#endif
48 +
49 /* Gnome Panel applets are XEMBED windows. We need to make sure we
50 * ignore them */
51
52 diff --git a/src/canberra-gtk.c b/src/canberra-gtk.c
53 index 34446f5..08cb668 100644
54 --- a/src/canberra-gtk.c
55 +++ b/src/canberra-gtk.c
56 @@ -185,6 +185,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) {
57 guchar *data = NULL;
58 gint ret = -1;
59
60 +#ifdef GDK_IS_X11_DISPLAY
61 + if (!GDK_IS_X11_DISPLAY(d))
62 + return 0;
63 +#endif
64 +
65 if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w),
66 gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"),
67 0, G_MAXLONG, False, XA_CARDINAL, &type_return,
68 --
69 1.7.7
|