commit a596b6499091a851d15c74b62c7cd82ce0a9a7a4
parent 695a8165f77dfaf7061551798870853275cf6560
Author: seninha <lucas@seninha.org>
Date: Sat, 18 Dec 2021 20:31:25 -0300
changes
Diffstat:
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/shod.1 b/shod.1
@@ -562,7 +562,7 @@ The placement of the dock can be changed with the
understands the following X resources.
.TP
.B shod.borderWidth
-The width of the borders and divisions
+The width of the borders and divisions.
.TP
.B shod.border.activeColors
Up to three colors, delimited by colons,
@@ -616,7 +616,7 @@ for the body color, light shadow color, and dark shadow color for the 3D effect
of title bars of urgent windows.
.TP
.B shod.titleWidth
-The width of the title bar
+The width of the title bar.
.SH ENVIRONMENT
The following environment variables affect the execution of
.B shod
diff --git a/shod.c b/shod.c
@@ -2560,19 +2560,19 @@ promptdecorate(struct Prompt *prompt, int w, int h)
int partw, parth;
int doubleshadow;
- doubleshadow = (config.borderwidth - 4 > 0);
+ if (prompt->pw == w && prompt->ph == h && prompt->pix != None)
+ goto done;
/* (re)create pixmap */
- if (prompt->pw != w || prompt->ph != h || prompt->pix == None) {
- if (prompt->pix != None)
- XFreePixmap(dpy, prompt->pix);
- prompt->pix = XCreatePixmap(dpy, prompt->frame, w, h, depth);
- }
+ if (prompt->pix != None)
+ XFreePixmap(dpy, prompt->pix);
+ prompt->pix = XCreatePixmap(dpy, prompt->frame, w, h, depth);
prompt->pw = w;
prompt->ph = h;
partw = w - 2 * config.borderwidth;
parth = h - 2 * config.borderwidth;
+ doubleshadow = (config.borderwidth - 4 > 0);
/* draw background */
val.foreground = visual.prompt[COLOR_MID];
@@ -2635,6 +2635,7 @@ promptdecorate(struct Prompt *prompt, int w, int h)
XChangeGC(dpy, gc, GCForeground, &val);
XFillRectangles(dpy, prompt->pix, gc, recs, doubleshadow ? 6 : 3);
+done:
XCopyArea(dpy, prompt->pix, prompt->frame, gc, 0, 0, w, h, 0, 0);
}