~mil/sxmo-st

21ed50bac27f571be61253120356ffa81cc4d153 — Kipras Melnikovas a month ago d63db73 master
Implement dynamic cursor color

Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
1 files changed, 13 insertions(+), 2 deletions(-)

M x.c
M x.c => x.c +13 -2
@@ 1548,6 1548,7 @@ void
xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
{
	Color drawcol;
	XRenderColor colbg;

	/* remove the old cursor */
	if (selected(ox, oy))


@@ 1577,10 1578,20 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
			g.fg = defaultfg;
			g.bg = defaultrcs;
		} else {
			g.bg = g.fg;
			g.fg = defaultbg;
			g.bg = defaultcs;
		}
		drawcol = dc.col[g.bg];

		if (IS_TRUECOL(g.bg)) {
			colbg.alpha = 0xffff;
			colbg.red = TRUERED(g.bg);
			colbg.green = TRUEGREEN(g.bg);
			colbg.blue = TRUEBLUE(g.bg);
			XftColorAllocValue(xw.dpy, xw.vis, xw.cmap,
			                   &colbg, &drawcol);
		} else {
			drawcol = dc.col[g.bg];
		}
	}

	/* draw the new one */