74ac90
diff --git a/configure.ac b/configure.ac
74ac90
index 62f53a3..a6f2f04 100644
74ac90
--- a/configure.ac
74ac90
+++ b/configure.ac
74ac90
@@ -1874,6 +1874,7 @@ if test "${HAVE_X11}" = "yes"; then
74ac90
   AC_MSG_RESULT($emacs_xkb)
74ac90
   if test $emacs_xkb = yes; then
74ac90
     AC_DEFINE(HAVE_XKBGETKEYBOARD, 1, [Define to 1 if you have the XkbGetKeyboard function.])
74ac90
+    AC_DEFINE(HAVE_XKB, 1, [Define to 1 if you have the Xkb extension.])
74ac90
   fi
74ac90
 
74ac90
   AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
74ac90
diff --git a/src/xterm.c b/src/xterm.c
74ac90
index fb407c8..f47141d 100644
74ac90
--- a/src/xterm.c
74ac90
+++ b/src/xterm.c
74ac90
@@ -130,6 +130,10 @@ extern void _XEditResCheckMessages (Widget, XtPointer, XEvent *, Boolean *);
74ac90
 
74ac90
 #include "bitmaps/gray.xbm"
74ac90
 
74ac90
+#ifdef HAVE_XKB
74ac90
+#include <X11/XKBlib.h>
74ac90
+#endif
74ac90
+
74ac90
 /* Default to using XIM if available.  */
74ac90
 #ifdef USE_XIM
74ac90
 int use_xim = 1;
74ac90
@@ -3243,7 +3247,11 @@ XTring_bell (struct frame *f)
74ac90
       else
74ac90
 	{
74ac90
 	  block_input ();
74ac90
+#ifdef HAVE_XKB
74ac90
+	  XkbBell (FRAME_X_DISPLAY (f), None, 0, None);
74ac90
+#else
74ac90
 	  XBell (FRAME_X_DISPLAY (f), 0);
74ac90
+#endif
74ac90
 	  XFlush (FRAME_X_DISPLAY (f));
74ac90
 	  unblock_input ();
74ac90
 	}