libcanberra-0.30-wayland.patch 2.3 KB

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