[gtk/untrusted-beep-3] x11: Don't beep on untrusted displays
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/untrusted-beep-3] x11: Don't beep on untrusted displays
- Date: Wed, 21 Apr 2021 00:57:35 +0000 (UTC)
commit bbdc5411ed36f611215a166c5f16c92e4dfe370a
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Apr 20 20:55:21 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/gdkwindow-x11.c | 3 +++
2 files changed, 6 insertions(+)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 817944e3a5..0033686fe2 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1964,6 +1964,9 @@ _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
static void
gdk_x11_display_beep (GdkDisplay *display)
{
+ if G_UNLIKELY (GDK_X11_DISPLAY (display)->trusted_client)
+ return;
+
#ifdef HAVE_XKB
XkbBell (GDK_DISPLAY_XDISPLAY (display), None, 0, None);
#else
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 38ff91da6d..c4d0d09478 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -5472,6 +5472,9 @@ gdk_x11_window_beep (GdkWindow *window)
display = GDK_WINDOW_DISPLAY (window);
+ if G_UNLIKELY (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]