Revert "Simplify cursor color handling"

This reverts commit 1911c9274d.
dev
Hiltjo Posthuma 2018-07-17 20:01:58 +02:00
parent 8ed7a4b3b7
commit 4f4bccd162
1 changed files with 18 additions and 12 deletions

22
x.c
View File

@ -1418,19 +1418,25 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
*/ */
g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE;
if (IS_SET(MODE_REVERSE)) {
g.mode |= ATTR_REVERSE;
g.bg = defaultfg;
if (selected(cx, cy)) { if (selected(cx, cy)) {
g.bg = defaultrcs; drawcol = dc.col[defaultcs];
g.fg = defaultfg; g.fg = defaultrcs;
} else {
drawcol = dc.col[defaultrcs];
g.fg = defaultcs;
}
} else {
if (selected(cx, cy)) {
g.fg = defaultfg;
g.bg = defaultrcs;
} else { } else {
g.bg = defaultcs;
g.fg = defaultbg; g.fg = defaultbg;
g.bg = defaultcs;
} }
drawcol = dc.col[g.bg]; drawcol = dc.col[g.bg];
if (IS_SET(MODE_REVERSE)) {
drawcol.color.red = ~drawcol.color.red;
drawcol.color.green = ~drawcol.color.green;
drawcol.color.blue = ~drawcol.color.blue;
} }
/* draw the new one */ /* draw the new one */