diff options
author | zachir <zachir@librem.one> | 2023-02-20 02:10:12 -0600 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-02-20 02:10:12 -0600 |
commit | db8eea792ac95be0d5a118480b296783bf774705 (patch) | |
tree | bb96164ef753227da9f2c7566b25ff20fcf2cfe9 /x.c | |
parent | de7b363ca2d073957bcb2fd08a0c9b4ab7f36861 (diff) |
add dynamic-cursor-color
Diffstat (limited to 'x.c')
-rw-r--r-- | x.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1555,6 +1555,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)) @@ -1583,11 +1584,21 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) if (selected(cx, cy)) { g.fg = defaultfg; g.bg = defaultrcs; + } else if (!(og.mode & ATTR_REVERSE)) { + unsigned long col = g.bg; + g.bg = g.fg; + g.fg = col; + } + + 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 { - g.fg = defaultbg; - g.bg = defaultcs; + drawcol = dc.col[g.bg]; } - drawcol = dc.col[g.bg]; } /* draw the new one */ |