[hackers] [st] Delay redrawals on palette changes || Santtu Lakkala

From: <git_AT_suckless.org>
Date: Fri, 18 Feb 2022 13:59:20 +0100 (CET)

commit e823e2308f2a99023032a3966ebb7036a31d305f
Author: Santtu Lakkala <inz_AT_inz.fi>
AuthorDate: Thu Feb 17 16:00:47 2022 +0200
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Fri Feb 18 13:03:37 2022 +0100

    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.

diff --git a/st.c b/st.c
index 51049ba..c71fa06 100644
--- a/st.c
+++ b/st.c
_AT_@ -1927,7 +1927,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)
_AT_@ -1940,7 +1940,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)
_AT_@ -1953,7 +1953,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 (narg < 3)
_AT_@ -1975,7 +1975,7 @@ strhandle(void)
                                  * TODO if defaultbg color is changed, borders
                                  * are dirty
                                  */
- redraw();
+ tfulldirt();
                         }
                         return;
                 }
Received on Fri Feb 18 2022 - 13:59:20 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 18 2022 - 14:00:40 CET