[gtk/gtk-4-2: 59/91] x11: Don't beep on untrusted displays
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-4-2: 59/91] x11: Don't beep on untrusted displays
- Date: Tue, 4 May 2021 02:05:41 +0000 (UTC)
commit 268c17450606e3a25f63e2a95fe9225aef116cb5
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Apr 20 20:53:02 2021 -0400
x11: Don't beep on untrusted displays
This can trigger BadAccess, and we don't
want that.
Fixes: #3862
gdk/x11/gdkdisplay-x11.c | 3 +++
gdk/x11/gdksurface-x11.c | 3 +++
2 files changed, 6 insertions(+)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 4350f2eef8..828889e977 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1795,6 +1795,9 @@ _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
static void
gdk_x11_display_beep (GdkDisplay *display)
{
+ if (!GDK_X11_DISPLAY (display)->trusted_client)
+ return;
+
#ifdef HAVE_XKB
XkbBell (GDK_DISPLAY_XDISPLAY (display), None, 0, None);
#else
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 210f584d64..aeaca9c0f9 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -4542,6 +4542,9 @@ gdk_x11_surface_beep (GdkSurface *surface)
display = GDK_SURFACE_DISPLAY (surface);
+ if (!GDK_X11_DISPLAY (display)->trusted_client)
+ return FALSE;
+
#ifdef HAVE_XKB
if (GDK_X11_DISPLAY (display)->use_xkb)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]