[hackers] [st] patch for bell in st || CustaiCo

From: <git_AT_suckless.org>
Date: Mon, 13 Oct 2014 19:17:49 +0200

commit 86633ada91d1c7d8be1bf0398caff8a62fb1b805
Author: CustaiCo <custaico_AT_openmailbox.org>
Date: Fri Oct 3 19:25:21 2014 +0000

    patch for bell in st
    
    The XBell() call currently used when a bell is recieved sends a message
    to the X server, but if the X server doesn't know how to sound it,
    it just gets ignored and I have not been able to find anywhere in x.org's
    code a way to configure the action that the server does.
    
    However, if you use XkbBell() then you can have a process listening for
    the XkbBellNotifyEvent that is produced and either alert you visually or
    play an audio file or whatever you want as your notification. You have
    to include one more header file but the function seems to be compiled as
    part of Xlib, at least on my installation.
    
    CustaiCo

diff --git a/st.c b/st.c
index 22a1ce6..c61b90a 100644
--- a/st.c
+++ b/st.c
_AT_@ -27,6 +27,7 @@
 #include <X11/cursorfont.h>
 #include <X11/keysym.h>
 #include <X11/Xft/Xft.h>
+#include <X11/XKBlib.h>
 #include <fontconfig/fontconfig.h>
 #include <wchar.h>
 
_AT_@ -2423,7 +2424,7 @@ tcontrolcode(uchar ascii) {
                         if(!(xw.state & WIN_FOCUSED))
                                 xseturgency(1);
                         if (bellvolume)
- XBell(xw.dpy, bellvolume);
+ XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL);
                 }
                 break;
         case '\033': /* ESC */
Received on Mon Oct 13 2014 - 19:17:49 CEST

This archive was generated by hypermail 2.3.0 : Mon Oct 13 2014 - 19:24:13 CEST