From 24c9ea1e51b057e59b5dbdc87007cbd07fb0f807 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Mon, 20 Apr 2020 12:19:05 +0200 Subject: [PATCH] [st][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 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/st.c b/st.c index 968df45..7e493bd 100644 --- a/st.c +++ b/st.c @@ -2021,10 +2021,8 @@ strhandle(void) fprintf(stderr, "erresc: invalid color j=%d, p=%s\n", 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 3c17fb2..0272cbe 100644 --- a/win.h +++ b/win.h @@ -40,3 +40,4 @@ void xsetpointermotion(int); void xsetsel(char *); int xstartdraw(void); void xximspot(int, int); +void xclearwin(void); \ No newline at end of file