Delay redrawals on palette changes

Build on auto-sync and only mark window dirty on palette changes and let
the event handler do the actual draw.

Ref.
   - https://git.suckless.org/st/commit/e823e2308f2a99023032a3966ebb7036a31d305f.html
This commit is contained in:
bakkeby 2022-02-24 13:46:37 +01:00
parent cc4595779d
commit 4a156b95f9
3 changed files with 14 additions and 22 deletions

View File

@ -1,4 +1,4 @@
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this st 0.8.4 (2f6e597, 2021-08-24) project has a different take on st patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more.
Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this st 0.8.5 (e823e23, 2022-02-17) project has a different take on st patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more.
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/st-flexipatch/blob/master/patches.def.h):
```c
@ -15,6 +15,8 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
### Changelog:
2022-02-24 - Upgraded to st 0.8.5 e823e23, 2022-02-17 - removing osc_10_11_12_2 patch as no longer relevant
2021-08-18 - Added the CSI 22 & 23 patch
2021-07-26 - Added columns patch
@ -196,13 +198,13 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
- [openurlonclick](https://www.reddit.com/r/suckless/comments/cc83om/st_open_url/)
- allows for URLs to be opened directly when you click on them
- [osc_10_11_12_2](https://st.suckless.org/patches/osc_10_11_12_2/)
- this patch adds support for OSC escape sequences 10, 11, and 12 in the way they are
implemented in most other terminals (e.g libvte, kitty)
- specifically it differs from [osc_10_11_12](https://st.suckless.org/patches/osc_10_11_12/)
in that it treats the background and foreground colors as distinct from palette colours 01
and 07 in order to facilitate the use of theme setting scripts like
[theme.sh](https://github.com/lemnos/theme.sh) which expect these colours to be distinct
- [~osc_10_11_12_2~](https://st.suckless.org/patches/osc_10_11_12_2/)
- ~this patch adds support for OSC escape sequences 10, 11, and 12 in the way they are~
~implemented in most other terminals (e.g libvte, kitty)~
- ~specifically it differs from~ [~osc_10_11_12~](https://st.suckless.org/patches/osc_10_11_12/)
~in that it treats the background and foreground colors as distinct from palette colours 01~
~and 07 in order to facilitate the use of theme setting scripts like~
[~theme.sh~](https://github.com/lemnos/theme.sh) ~which expect these colours to be distinct~
- [relativeborder](https://st.suckless.org/patches/relativeborder/)
- allows you to specify a border that is relative in size to the width of a cell in the

View File

@ -246,16 +246,6 @@
*/
#define OPENURLONCLICK_PATCH 0
/* This patch adds support for OSC escape sequences 10, 11 and 12 that modify the background,
* foreground and cursor colors in the way they are implemented in most other terminals
* (e.g libvte, kitty). Specifically it differs from https://st.suckless.org/patches/osc_10_11_12/
* in that it treats the background and foreground colors as distinct from palette colours
* 01 and 07 in order to facilitate the use of theme setting scripts like theme.sh
* (https://github.com/lemnos/theme.sh) which expect these colours to be distinct.
* https://st.suckless.org/patches/osc_10_11_12_2/
*/
#define OSC_10_11_12_2_PATCH 0
/* This patch allows you to specify a border that is relative in size to the width of a cell
* in the terminal.
* https://st.suckless.org/patches/relativeborder/

8
st.c
View File

@ -2492,7 +2492,7 @@ strhandle(void)
else if (xsetcolorname(defaultfg, p))
fprintf(stderr, "erresc: invalid foreground color: %s\n", p);
else
redraw();
tfulldirt();
return;
case 11:
if (narg < 2)
@ -2505,7 +2505,7 @@ strhandle(void)
else if (xsetcolorname(defaultbg, p))
fprintf(stderr, "erresc: invalid background color: %s\n", p);
else
redraw();
tfulldirt();
return;
case 12:
if (narg < 2)
@ -2518,7 +2518,7 @@ strhandle(void)
else if (xsetcolorname(defaultcs, p))
fprintf(stderr, "erresc: invalid cursor color: %s\n", p);
else
redraw();
tfulldirt();
return;
case 4: /* color set */
if ((par == 4 && narg < 3) || narg < 2)
@ -2545,7 +2545,7 @@ strhandle(void)
} else {
if (j == defaultbg)
xclearwin();
redraw();
tfulldirt();
}
return;
}