merge ftrv's glitchy background fix

This commit is contained in:
xfnw 2022-07-10 19:13:13 -04:00
parent 33ba68d23d
commit f725e8b433

View file

@ -266,11 +266,13 @@ iconinit(void)
} }
} }
void resized(void);
void redraw(void); void redraw(void);
void void
themeload(char *s, int n) themeload(char *s, int n)
{ {
int i, fd; int i, fd, rioback;
char *t, *a[2], *e, *newp; char *t, *a[2], *e, *newp;
Image *newc, *repl; Image *newc, *repl;
u32int rgb; u32int rgb;
@ -280,6 +282,7 @@ themeload(char *s, int n)
memmove(t, s, n); memmove(t, s, n);
t[n] = 0; t[n] = 0;
rioback = 0;
for(s = t; s != nil && *s; s = e){ for(s = t; s != nil && *s; s = e){
if((e = strchr(s, '\n')) != nil) if((e = strchr(s, '\n')) != nil)
*e++ = 0; *e++ = 0;
@ -316,6 +319,7 @@ themeload(char *s, int n)
if(new != nil){ if(new != nil){
freeimage(col[i]); freeimage(col[i]);
col[i] = newc; col[i] = newc;
rioback |= i == Colrioback;
} }
break; break;
} }
@ -324,6 +328,8 @@ themeload(char *s, int n)
} }
End: End:
free(t); free(t);
if(rioback)
resized();
redraw(); redraw();
} }