1 From 01e706efbc13194a4a4404e91b93a9638a3c1bea Mon Sep 17 00:00:00 2001
2 From: Kipras Melnikovas <kipras@kipras.org>
3 Date: Thu, 25 Feb 2021 14:31:26 +0200
4 Subject: [PATCH] refactor dynamic-cursor-color patch
6 Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
8 x.c | 19 +++++++++++++++++--
9 1 file changed, 17 insertions(+), 2 deletions(-)
11 diff --git a/x.c b/x.c
12 index 120e495..ab66364 100644
15 @@ -1489,6 +1489,7 @@ void
16 xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
21 /* remove the old cursor */
23 @@ -1518,10 +1519,24 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
27 + /** this is the main part of the dynamic cursor color patch */
32 - drawcol = dc.col[g.bg];
35 + * and this is the second part of the dynamic cursor color patch.
36 + * it handles the `drawcol` variable
38 + if (IS_TRUECOL(g.bg)) {
39 + colbg.alpha = 0xffff;
40 + colbg.red = TRUERED(g.bg);
41 + colbg.green = TRUEGREEN(g.bg);
42 + colbg.blue = TRUEBLUE(g.bg);
43 + XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, &drawcol);
45 + drawcol = dc.col[g.bg];
49 /* draw the new one */