* [bug#43918] [PATCH] gnu: libcanberra: Fix a crash on wayland
@ 2020-10-11 2:04 Julien Lepiller
2020-10-12 19:31 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Julien Lepiller @ 2020-10-11 2:04 UTC (permalink / raw)
To: 43918
[-- Attachment #1: Type: text/plain, Size: 410 bytes --]
Hi Guix!
Trying to play with sway, I noticed a crash in pavucontrol, when
changing the volume of outputs (strangely enough, not of individual
applications). This was already reported upstream, and they found the
cause to be the assumption libcanberra makes that you're running on
Xorg. This commit adds a patch that remove this assumption, and was
pushed to libcanberra after the latest release (in 2012!).
[-- Attachment #2: 0001-gnu-libcanberra-Fix-crashes-on-wayland.patch --]
[-- Type: text/x-patch, Size: 4256 bytes --]
From 98f3633c36ff4638910b4507cd09990910cac790 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sun, 11 Oct 2020 03:58:50 +0200
Subject: [PATCH] gnu: libcanberra: Fix crashes on wayland.
* gnu/packages/patches/libcanberra-wayland-crash.patch: New file.
* gnu/packages/libcanberra.scm (libcanberra): Add it.
* gnu/local.mk (dist_PATCH_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/libcanberra.scm | 3 +-
.../patches/libcanberra-wayland-crash.patch | 55 +++++++++++++++++++
3 files changed, 58 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/libcanberra-wayland-crash.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index b59b122e86..a34902abc9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1228,6 +1228,7 @@ dist_patch_DATA = \
%D%/packages/patches/libbase-use-own-logging.patch \
%D%/packages/patches/libbonobo-activation-test-race.patch \
%D%/packages/patches/libcanberra-sound-theme-freedesktop.patch \
+ %D%/packages/patches/libcanberra-wayland-crash.patch \
%D%/packages/patches/libdrm-realpath-virtio.patch \
%D%/packages/patches/libgeotiff-adapt-test-script-for-proj-6.2.patch \
%D%/packages/patches/libgit2-mtime-0.patch \
diff --git a/gnu/packages/libcanberra.scm b/gnu/packages/libcanberra.scm
index 32d1cd3605..2d08fb46e3 100644
--- a/gnu/packages/libcanberra.scm
+++ b/gnu/packages/libcanberra.scm
@@ -69,7 +69,8 @@
;; his pleasure.
(patch-flags '("-p0"))
(patches
- (search-patches "libcanberra-sound-theme-freedesktop.patch"))))
+ (search-patches "libcanberra-sound-theme-freedesktop.patch"
+ "libcanberra-wayland-crash.patch"))))
(build-system gnu-build-system)
(inputs
`(("alsa-lib" ,alsa-lib)
diff --git a/gnu/packages/patches/libcanberra-wayland-crash.patch b/gnu/packages/patches/libcanberra-wayland-crash.patch
new file mode 100644
index 0000000000..e347436bbe
--- /dev/null
+++ b/gnu/packages/patches/libcanberra-wayland-crash.patch
@@ -0,0 +1,55 @@
+# This patch comes from upstream commit c0620e432650e81062c1967cc669829dbd29b310.
+# gtk: Don't assume all GdkDisplays are GdkX11Displays: broadway/wayland
+
+--- src/canberra-gtk-module.c.orig
++++ src/canberra-gtk-module.c
+@@ -307,6 +307,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) {
+ 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 @@ static gint display_get_desktop(GdkDisplay *d) {
+ 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 @@ static gboolean window_is_xembed(GdkDisplay *d, GdkWindow *w) {
+ 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 */
+
+--- src/canberra-gtk.c.orig
++++ src/canberra-gtk.c
+@@ -185,6 +185,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) {
+ 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,
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [bug#43918] [PATCH] gnu: libcanberra: Fix a crash on wayland
2020-10-11 2:04 [bug#43918] [PATCH] gnu: libcanberra: Fix a crash on wayland Julien Lepiller
@ 2020-10-12 19:31 ` Ludovic Courtès
2020-10-12 19:52 ` bug#43918: " Julien Lepiller
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2020-10-12 19:31 UTC (permalink / raw)
To: Julien Lepiller; +Cc: 43918
Hello,
Julien Lepiller <julien@lepiller.eu> skribis:
>>From 98f3633c36ff4638910b4507cd09990910cac790 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Sun, 11 Oct 2020 03:58:50 +0200
> Subject: [PATCH] gnu: libcanberra: Fix crashes on wayland.
>
> * gnu/packages/patches/libcanberra-wayland-crash.patch: New file.
> * gnu/packages/libcanberra.scm (libcanberra): Add it.
> * gnu/local.mk (dist_PATCH_DATA): Add it.
LGTM! I think it can go on ‘master’.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#43918: [PATCH] gnu: libcanberra: Fix a crash on wayland
2020-10-12 19:31 ` Ludovic Courtès
@ 2020-10-12 19:52 ` Julien Lepiller
0 siblings, 0 replies; 3+ messages in thread
From: Julien Lepiller @ 2020-10-12 19:52 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 43918-done
Le Mon, 12 Oct 2020 21:31:37 +0200,
Ludovic Courtès <ludo@gnu.org> a écrit :
> Hello,
>
> Julien Lepiller <julien@lepiller.eu> skribis:
>
> >>From 98f3633c36ff4638910b4507cd09990910cac790 Mon Sep 17 00:00:00
> >>2001
> > From: Julien Lepiller <julien@lepiller.eu>
> > Date: Sun, 11 Oct 2020 03:58:50 +0200
> > Subject: [PATCH] gnu: libcanberra: Fix crashes on wayland.
> >
> > * gnu/packages/patches/libcanberra-wayland-crash.patch: New file.
> > * gnu/packages/libcanberra.scm (libcanberra): Add it.
> > * gnu/local.mk (dist_PATCH_DATA): Add it.
>
> LGTM! I think it can go on ‘master’.
>
> Thanks,
> Ludo’.
Thank you, pushed as ec82d58526c27a9ca26f6c5e39cec90a48cbc1cc.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-12 19:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-11 2:04 [bug#43918] [PATCH] gnu: libcanberra: Fix a crash on wayland Julien Lepiller
2020-10-12 19:31 ` Ludovic Courtès
2020-10-12 19:52 ` bug#43918: " Julien Lepiller
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).