[wiki] [sites] [st] Update visualbell patch || Alexis Ben Miloud--Josselin

From: <git_AT_suckless.org>
Date: Sun, 24 Sep 2017 18:40:03 +0200

commit 77c728f17b05f0a3ac5a8e0c18d581dfc5aa5d29
Author: Alexis Ben Miloud--Josselin <alexis.bmj_AT_protonmail.com>
Date: Sun Sep 24 18:39:41 2017 +0200

    [st] Update visualbell patch

diff --git a/st.suckless.org/patches/visualbell/index.md b/st.suckless.org/patches/visualbell/index.md
index 5767f052..f02b56a4 100644
--- a/st.suckless.org/patches/visualbell/index.md
+++ b/st.suckless.org/patches/visualbell/index.md
_AT_@ -17,9 +17,11 @@ Download
 --------
 
  * [st-visualbell-20160727-308bfbf.diff](st-visualbell-20160727-308bfbf.diff)
+ * [st-visualbell-20170924-b1338e9.diff](st-visualbell-20170924-b1338e9.diff)
 
 Authors
 -------
 
  * Matthias Schoth - <mschoth_AT_gmail.com>
  * Laslo Hunhold - <dev_AT_frign.de> (git port)
+ * Alexis Ben Miloud--Josselin - <alexis.bmj_AT_protonmail.com> (update)
diff --git a/st.suckless.org/patches/visualbell/st-visualbell-20170924-b1338e9.diff b/st.suckless.org/patches/visualbell/st-visualbell-20170924-b1338e9.diff
new file mode 100644
index 00000000..3e6cf60d
--- /dev/null
+++ b/st.suckless.org/patches/visualbell/st-visualbell-20170924-b1338e9.diff
_AT_@ -0,0 +1,58 @@
+diff --git a/st.c b/st.c
+index 7c7ddff..a3dffe5 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -218,6 +218,7 @@ char *opt_line = NULL;
+ char *opt_name = NULL;
+ char *opt_title = NULL;
+ int oldbutton = 3; /* button event on startup: 3 = release */
++int bellon = 0;
+
+ static CSIEscape csiescseq;
+ static STREscape strescseq;
+diff --git a/st.h b/st.h
+index 44d4938..24a6eb6 100644
+--- a/st.h
++++ b/st.h
+_AT_@ -231,6 +231,7 @@ extern char *opt_line;
+ extern char *opt_name;
+ extern char *opt_title;
+ extern int oldbutton;
++extern int bellon;
+
+ extern char *usedfont;
+ extern double usedfontsize;
+diff --git a/x.c b/x.c
+index 191e5dc..7be81ea 100644
+--- a/x.c
++++ b/x.c
+_AT_@ -1483,6 +1483,15 @@ void
+ xbell(int vol)
+ {
+ XkbBell(xw.dpy, xw.win, vol, (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);
++ }
+ }
+
+ unsigned long
+_AT_@ -1674,7 +1683,12 @@ run(void)
+ (handler[ev.type])(&ev);
+ }
+
+- draw();
++ if (bellon) {
++ bellon = 0;
++ redraw();
++ }
++ else draw();
++
+ XFlush(xw.dpy);
+
+ if (xev && !FD_ISSET(xfd, &rfd))
Received on Sun Sep 24 2017 - 18:40:03 CEST

This archive was generated by hypermail 2.3.0 : Sun Sep 24 2017 - 18:48:21 CEST