commit 0d932db493af0d566b817658f2930b7a934e3699
Author: Matthias Schoth <[email protected]>
Date:   Tue Feb 9 18:04:14 2016 +0100

    [st] Introducing visualbell patch

diff --git a/st.suckless.org/patches/st-git-20160209-visualbell.diff 
b/st.suckless.org/patches/st-git-20160209-visualbell.diff
new file mode 100644
index 0000000..5682b6e
--- /dev/null
+++ b/st.suckless.org/patches/st-git-20160209-visualbell.diff
@@ -0,0 +1,42 @@
+diff --git a/st.c b/st.c
+index 0536b6f..948de40 100644
+--- a/st.c
++++ b/st.c
+@@ -532,6 +532,7 @@ static char *opt_line  = NULL;
+ static char *opt_name  = NULL;
+ static char *opt_title = NULL;
+ static int oldbutton   = 3; /* button event on startup: 3 = release */
++static int bellon      = 0; /* visual bell status */
+ 
+ static char *usedfont = NULL;
+ static double usedfontsize = 0;
+@@ -2767,6 +2768,15 @@ tcontrolcode(uchar ascii)
+                               xseturgency(1);
+                       if (bellvolume)
+                               XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL);
++
++                        /* visual bell*/
++                        if (!bellon) {
++                                bellon = 1;
++                                MODBIT(term.mode, !IS_SET(MODE_REVERSE), 
MODE_REVERSE);
++                                redraw();
++                                XFlush(xw.dpy);
++                                MODBIT(term.mode, !IS_SET(MODE_REVERSE), 
MODE_REVERSE);
++                        }
+               }
+               break;
+       case '': /* ESC */
+@@ -4303,7 +4313,12 @@ run(void)
+                                       (handler[ev.type])(&ev);
+                       }
+ 
+-                      draw();
++                      if (bellon) {
++                              bellon = 0;
++                              redraw();
++                      }
++                      else draw();
++
+                       XFlush(xw.dpy);
+ 
+                       if (xev && !FD_ISSET(xfd, &rfd))
diff --git a/st.suckless.org/patches/visualbell.md 
b/st.suckless.org/patches/visualbell.md
new file mode 100644
index 0000000..ab71853
--- /dev/null
+++ b/st.suckless.org/patches/visualbell.md
@@ -0,0 +1,24 @@
+visualbell
+==========
+
+Description
+-----------
+
+Briefly inverts window content on terminal bell event.
+
+Notes
+-----
+
+In order to be noticeable you might have to reduce the `xfps`
+value in `config.h` to less than equal the refresh rate of your
+monitor.
+
+Download
+--------
+
+ * [st-git-20160209-visualbell.diff](st-git-20160209-visualbell.diff)
+
+Authors
+-------
+
+ * Matthias Schoth - [email protected]


Reply via email to