]> Sergey Matveev's repositories - st.git/commitdiff
Delay redrawals on palette changes
authorSanttu Lakkala <inz@inz.fi>
Thu, 17 Feb 2022 14:00:47 +0000 (16:00 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 18 Feb 2022 12:03:37 +0000 (13:03 +0100)
Build on auto-sync and only mark window dirty on palette changes and let
the event handler do the actual draw.

st.c

diff --git a/st.c b/st.c
index 51049ba22b86cb7f13d99b1c880504c0362ba320..c71fa0677ee40d7ba71b5b67fbb70b4386500be8 100644 (file)
--- a/st.c
+++ b/st.c
@@ -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)
@@ -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)
@@ -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)
@@ -1975,7 +1975,7 @@ strhandle(void)
                                 * TODO if defaultbg color is changed, borders
                                 * are dirty
                                 */
-                               redraw();
+                               tfulldirt();
                        }
                        return;
                }