[wiki] [sites] Implements TODO to update borders on bg color change || Christian Tenllado

From: <git_AT_suckless.org>
Date: Wed, 06 May 2020 09:46:18 +0200

commit dccbe1cca7227749a33b3b31d2097c4f7943213b
Author: Christian Tenllado <ctenllado_AT_gmail.com>
Date: Wed May 6 09:45:11 2020 +0200

    Implements TODO to update borders on bg color change
    
    When an OCS sequence was used to change the bg color, the borders where
    dirty. This simple patch just clears the window before the redraw of the
    terminal when the bg color has been changed. This is apparently smooth
    and solves the problem. There was a TODO comment for it on the st.c
    file, which I removed.

diff --git a/st.suckless.org/patches/xclearwin/index.md b/st.suckless.org/patches/xclearwin/index.md
new file mode 100644
index 00000000..02c39b13
--- /dev/null
+++ b/st.suckless.org/patches/xclearwin/index.md
_AT_@ -0,0 +1,18 @@
+xclearwin
+=========
+
+Description
+-----------
+When an OCS sequence was used to change the bg color, the borders where
+dirty. This simple patch just clears the window before the redraw of the
+terminal when the bg color has been changed. This is apparently smooth
+and solves the problem. There was a TODO comment for it on the st.c
+file, which I removed.
+
+Download
+--------
+* [st-xclearwin-20200419-6ee7143.diff](st-xresources-20180309-c5ba9c0.diff)
+
+Authors
+-------
+* Christian Tenllado - <ctenllado_AT_gmail.com>
diff --git a/st.suckless.org/patches/xclearwin/st-xclearwin-20200419-6ee7143.diff b/st.suckless.org/patches/xclearwin/st-xclearwin-20200419-6ee7143.diff
new file mode 100644
index 00000000..52f04772
--- /dev/null
+++ b/st.suckless.org/patches/xclearwin/st-xclearwin-20200419-6ee7143.diff
_AT_@ -0,0 +1,62 @@
+From 6ee7143600e5ac6c7a26d2ee985ac2a3087a5570 Mon Sep 17 00:00:00 2001
+From: Christian Tenllado <ctenllado_AT_gmail.com>
+Date: Sun, 19 Apr 2020 11:57:31 +0200
+Subject: [PATCH] xclearwin clears the window
+
+When an OCS sequence was used to change the bg color, the borders where
+dirty. This simple patch just clears the window before the redraw of the
+terminal when the bg color has been changed. This is apparently enough
+and seams to be very smooth. There was a TODO comment for it on the st.c
+file, which I removed.
+---
+ st.c | 6 ++----
+ win.h | 1 +
+ x.c | 6 ++++++
+ 3 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/st.c b/st.c
+index 3e48410..2efb4bd 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -1874,10 +1874,8 @@ strhandle(void)
+ fprintf(stderr, "erresc: invalid color j=%d, p=%s
",
+ j, p ? p : "(null)");
+ } else {
+- /*
+- * TODO if defaultbg color is changed, borders
+- * are dirty
+- */
++ if (j == defaultbg)
++ xclearwin();
+ redraw();
+ }
+ return;
+diff --git a/win.h b/win.h
+index a6ef1b9..d7b4980 100644
+--- a/win.h
++++ b/win.h
+_AT_@ -37,3 +37,4 @@ void xsetpointermotion(int);
+ void xsetsel(char *);
+ int xstartdraw(void);
+ void xximspot(int, int);
++void xclearwin(void);
+diff --git a/x.c b/x.c
+index 4cf6b21..afd35e0 100644
+--- a/x.c
++++ b/x.c
+_AT_@ -825,6 +825,12 @@ xclear(int x1, int y1, int x2, int y2)
+ x1, y1, x2-x1, y2-y1);
+ }
+
++void
++xclearwin(void)
++{
++ xclear(0, 0, win.w, win.h);
++}
++
+ void
+ xhints(void)
+ {
+--
+2.20.1
+
Received on Wed May 06 2020 - 09:46:18 CEST

This archive was generated by hypermail 2.3.0 : Wed May 06 2020 - 09:48:50 CEST