aboutsummaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-07-17 20:01:54 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-07-17 20:01:54 +0200
commit732be223ee7ba5486713c63f944699fd6285af96 (patch)
treefb7582a0413fec0816cda3b7375235aa372bcb0c /x.c
parent5535c1f04c665c05faff2a65d5558246b7748d49 (diff)
downloadst-patched-732be223ee7ba5486713c63f944699fd6285af96.tar.bz2
st-patched-732be223ee7ba5486713c63f944699fd6285af96.tar.xz
st-patched-732be223ee7ba5486713c63f944699fd6285af96.zip
Revert "Fix crash when cursor color is truecolor"
This reverts commit 5535c1f04c665c05faff2a65d5558246b7748d49.
Diffstat (limited to 'x.c')
-rw-r--r--x.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/x.c b/x.c
index 4155a70..b51821d 100644
--- a/x.c
+++ b/x.c
@@ -1404,7 +1404,6 @@ void
1404xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) 1404xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
1405{ 1405{
1406 Color drawcol; 1406 Color drawcol;
1407 uint32_t cc;
1408 1407
1409 /* remove the old cursor */ 1408 /* remove the old cursor */
1410 if (selected(ox, oy)) 1409 if (selected(ox, oy))
@@ -1420,22 +1419,14 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
1420 g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; 1419 g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE;
1421 1420
1422 if (selected(cx, cy)) { 1421 if (selected(cx, cy)) {
1423 cc = g.bg; 1422 drawcol = dc.col[g.bg];
1424 } else { 1423 } else {
1425 g.mode |= ATTR_REVERSE; 1424 g.mode |= ATTR_REVERSE;
1425
1426 if (g.mode & ATTR_BOLD && BETWEEN(g.fg, 0, 7)) 1426 if (g.mode & ATTR_BOLD && BETWEEN(g.fg, 0, 7))
1427 cc = g.fg + 8; 1427 drawcol = dc.col[g.fg + 8];
1428 else 1428 else
1429 cc = g.fg; 1429 drawcol = dc.col[g.fg];
1430 }
1431
1432 if (IS_TRUECOL(cc)) {
1433 drawcol.color.alpha = 0xffff;
1434 drawcol.color.red = TRUERED(cc);
1435 drawcol.color.green = TRUEGREEN(cc);
1436 drawcol.color.blue = TRUEBLUE(cc);
1437 } else {
1438 drawcol = dc.col[cc];
1439 } 1430 }
1440 1431
1441 if (IS_SET(MODE_REVERSE)) { 1432 if (IS_SET(MODE_REVERSE)) {