Unverified Commit d2201dd6 authored by Olli Helenius's avatar Olli Helenius
Browse files

libcanberra: use a local copy of the `GdkDisplay` patch

The patch is no longer available from git.0pointer.net.
parent e26385b4
Loading
Loading
Loading
Loading
+52 −0
Original line number Diff line number Diff line
--- a/src/canberra-gtk-module.c
+++ b/src/canberra-gtk-module.c
@@ -307,6 +307,11 @@
         guchar *data = NULL;
         gint ret = -1;
 
+#ifdef GDK_IS_X11_DISPLAY
+        if (!GDK_IS_X11_DISPLAY(d))
+                return 0;
+#endif
+
         if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w),
                                gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"),
                                0, G_MAXLONG, False, XA_CARDINAL, &type_return,
@@ -335,6 +340,11 @@
         guchar *data = NULL;
         gint ret = -1;
 
+#ifdef GDK_IS_X11_DISPLAY
+        if (!GDK_IS_X11_DISPLAY(d))
+                return 0;
+#endif
+
         if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), DefaultRootWindow(GDK_DISPLAY_XDISPLAY(d)),
                                gdk_x11_get_xatom_by_name_for_display(d, "_NET_CURRENT_DESKTOP"),
                                0, G_MAXLONG, False, XA_CARDINAL, &type_return,
@@ -365,6 +375,11 @@
         gboolean ret = FALSE;
         Atom xembed;
 
+#ifdef GDK_IS_X11_DISPLAY
+        if (!GDK_IS_X11_DISPLAY(d))
+                return FALSE;
+#endif
+
         /* Gnome Panel applets are XEMBED windows. We need to make sure we
          * ignore them */
 
--- a/src/canberra-gtk.c
+++ b/src/canberra-gtk.c
@@ -185,6 +185,11 @@
         guchar *data = NULL;
         gint ret = -1;
 
+#ifdef GDK_IS_X11_DISPLAY
+        if (!GDK_IS_X11_DISPLAY(d))
+                return 0;
+#endif
+
         if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w),
                                gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"),
                                0, G_MAXLONG, False, XA_CARDINAL, &type_return,
+1 −5
Original line number Diff line number Diff line
@@ -55,11 +55,7 @@ stdenv.mkDerivation (finalAttrs: {
  ++ lib.optional stdenv.hostPlatform.isLinux "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system";

  patches = [
    (fetchpatch {
      name = "0001-gtk-Don-t-assume-all-GdkDisplays-are-GdkX11Displays-.patch";
      url = "http://git.0pointer.net/libcanberra.git/patch/?id=c0620e432650e81062c1967cc669829dbd29b310";
      sha256 = "0rc7zwn39yxzxp37qh329g7375r5ywcqcaak8ryd0dgvg8m5hcx9";
    })
    ./0001-gtk-Don-t-assume-all-GdkDisplays-are-GdkX11Displays-.patch
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    (fetchpatch {