[wiki] [sites] [st][patch][visualbell] Update patch to newest st version 0.8.4 || Matthias Schoth

From: <git_AT_suckless.org>
Date: Sat, 25 Jul 2020 00:20:23 +0200

commit 04aee4cdae831033db295019ef806f9f008e418a
Author: Matthias Schoth <mschoth_AT_gmail.com>
Date: Sat Jul 25 00:16:17 2020 +0200

    [st][patch][visualbell] Update patch to newest st version 0.8.4

diff --git a/st.suckless.org/patches/visualbell/index.md b/st.suckless.org/patches/visualbell/index.md
index 2ce06caa..7d91ff0d 100644
--- a/st.suckless.org/patches/visualbell/index.md
+++ b/st.suckless.org/patches/visualbell/index.md
_AT_@ -7,8 +7,9 @@ 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.
+For versions prior to 0.8.4 you might have to reduce the `xfps` value in
+`config.h` to less than equal the refresh rate of your monitor in order to be
+noticeable. This is not necessary for version 0.8.4 and later.
 
 Download
 --------
_AT_@ -16,6 +17,7 @@ Download
 * [st-visualbell-20180101-1f24bde.diff](st-visualbell-20180101-1f24bde.diff)
 * [st-visualbell-0.8.1.diff](st-visualbell-0.8.1.diff)
 * [st-visualbell-0.8.3.diff](st-visualbell-0.8.3.diff)
+* [st-visualbell-0.8.4.diff](st-visualbell-0.8.4.diff)
 
 Authors
 -------
diff --git a/st.suckless.org/patches/visualbell/st-visualbell-0.8.4.diff b/st.suckless.org/patches/visualbell/st-visualbell-0.8.4.diff
new file mode 100644
index 00000000..341d27b1
--- /dev/null
+++ b/st.suckless.org/patches/visualbell/st-visualbell-0.8.4.diff
_AT_@ -0,0 +1,48 @@
+From b7f2e9e933710e3339b710e24e37c6f0b3befa34 Mon Sep 17 00:00:00 2001
+From: Matthias Schoth <mschoth_AT_gmail.com>
+Date: Fri, 24 Jul 2020 23:55:31 +0200
+Subject: [PATCH] visualbell
+
+---
+ x.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/x.c b/x.c
+index 210f184..bcf61f1 100644
+--- a/x.c
++++ b/x.c
+_AT_@ -253,6 +253,7 @@ 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 */
+
+ void
+ clipcopy(const Arg *dummy)
+_AT_@ -1713,6 +1714,8 @@ xbell(void)
+ xseturgency(1);
+ if (bellvolume)
+ XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL);
++ if (!bellon) /* turn visual bell on */
++ bellon = 1;
+ }
+
+ void
+_AT_@ -1958,7 +1961,13 @@ run(void)
+ }
+ }
+
+- draw();
++ if (bellon) {
++ bellon++;
++ bellon %= 3;
++ MODBIT(win.mode, !IS_SET(MODE_REVERSE), MODE_REVERSE);
++ redraw();
++ }
++ else draw();
+ XFlush(xw.dpy);
+ drawing = 0;
+ }
+--
+2.27.0
+
Received on Sat Jul 25 2020 - 00:20:23 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 25 2020 - 00:24:43 CEST