Apply st-dynamic-cursor-color patch
This commit is contained in:
parent
a0b230f4be
commit
f302b2529c
1 changed files with 15 additions and 4 deletions
17
x.c
17
x.c
|
@ -1520,6 +1520,7 @@ void
|
||||||
xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
|
xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
|
||||||
{
|
{
|
||||||
Color drawcol;
|
Color drawcol;
|
||||||
|
XRenderColor colbg;
|
||||||
|
|
||||||
/* remove the old cursor */
|
/* remove the old cursor */
|
||||||
if (selected(ox, oy))
|
if (selected(ox, oy))
|
||||||
|
@ -1548,12 +1549,22 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
|
||||||
if (selected(cx, cy)) {
|
if (selected(cx, cy)) {
|
||||||
g.fg = defaultfg;
|
g.fg = defaultfg;
|
||||||
g.bg = defaultrcs;
|
g.bg = defaultrcs;
|
||||||
} else {
|
} else if (!(og.mode & ATTR_REVERSE)) {
|
||||||
g.fg = defaultbg;
|
unsigned long col = g.bg;
|
||||||
g.bg = defaultcs;
|
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 {
|
||||||
drawcol = dc.col[g.bg];
|
drawcol = dc.col[g.bg];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* draw the new one */
|
/* draw the new one */
|
||||||
if (IS_SET(MODE_FOCUSED)) {
|
if (IS_SET(MODE_FOCUSED)) {
|
||||||
|
|
Loading…
Reference in a new issue