summaryrefslogtreecommitdiff
path: root/files/config/suckless/st/x.c.orig
diff options
context:
space:
mode:
authorshipwreckt <me@shipwreckt.co.uk>2025-10-16 22:13:02 +0100
committershipwreckt <me@shipwreckt.co.uk>2025-10-16 22:13:02 +0100
commite63a16b509b05993fc7900b6296ba8601e343976 (patch)
treeb9e1d57e09a111981427bafe3b3223384e358830 /files/config/suckless/st/x.c.orig
parente8b5675eb77aa20027f369ca278457b6a7c2e142 (diff)
More small changes, added thunderbird items.
Diffstat (limited to 'files/config/suckless/st/x.c.orig')
-rw-r--r--files/config/suckless/st/x.c.orig21
1 files changed, 16 insertions, 5 deletions
diff --git a/files/config/suckless/st/x.c.orig b/files/config/suckless/st/x.c.orig
index d73152b..7157e56 100644
--- a/files/config/suckless/st/x.c.orig
+++ b/files/config/suckless/st/x.c.orig
@@ -1240,6 +1240,8 @@ xinit(int cols, int rows)
xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0);
if (xsel.xtarget == None)
xsel.xtarget = XA_STRING;
+
+ boxdraw_xinit(xw.dpy, xw.cmap, xw.draw, xw.vis);
}
int
@@ -1286,8 +1288,13 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
yp = winy + font->ascent;
}
- /* Lookup character index with default font. */
- glyphidx = XftCharIndex(xw.dpy, font->match, rune);
+ if (mode & ATTR_BOXDRAW) {
+ /* minor shoehorning: boxdraw uses only this ushort */
+ glyphidx = boxdrawindex(&glyphs[i]);
+ } else {
+ /* Lookup character index with default font. */
+ glyphidx = XftCharIndex(xw.dpy, font->match, rune);
+ }
if (glyphidx) {
specs[numspecs].font = font->match;
specs[numspecs].glyph = glyphidx;
@@ -1491,8 +1498,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
r.width = width;
XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1);
- /* Render the glyphs. */
- XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
+ if (base.mode & ATTR_BOXDRAW) {
+ drawboxes(winx, winy, width / len, win.ch, fg, bg, specs, len);
+ } else {
+ /* Render the glyphs. */
+ XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
+ }
/* Render underline and strikethrough. */
if (base.mode & ATTR_UNDERLINE) {
@@ -1535,7 +1546,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
/*
* Select the right color for the right mode.
*/
- g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE;
+ g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE|ATTR_BOXDRAW;
if (IS_SET(MODE_REVERSE)) {
g.mode |= ATTR_REVERSE;