aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2015-10-06 00:21:44 +0200
committerChristoph Lohmann <20h@r-36.net>2015-10-06 00:21:44 +0200
commit2ea02c937e3a1810050a5fb9f51e7e522d23af3b (patch)
tree249698d2484e1481d250a557a7a5f80a86351858
parent80fe97f8a66d31945bdddbb9381b2cc54359f48e (diff)
downloadst-patched-2ea02c937e3a1810050a5fb9f51e7e522d23af3b.tar.bz2
st-patched-2ea02c937e3a1810050a5fb9f51e7e522d23af3b.tar.xz
st-patched-2ea02c937e3a1810050a5fb9f51e7e522d23af3b.zip
Normalize the whole color selection in xdrawcursor.
-rw-r--r--st.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/st.c b/st.c
index d9f0ba6..e885a7d 100644
--- a/st.c
+++ b/st.c
@@ -3850,12 +3850,29 @@ xdrawcursor(void)
3850 xdrawglyph(og, oldx, oldy); 3850 xdrawglyph(og, oldx, oldy);
3851 3851
3852 g.u = term.line[term.c.y][term.c.x].u; 3852 g.u = term.line[term.c.y][term.c.x].u;
3853 if (ena_sel && selected(term.c.x, term.c.y)) { 3853
3854 drawcol = dc.col[defaultrcs]; 3854 /*
3855 g.fg = defaultfg; 3855 * Select the right color for the right mode.
3856 g.bg = defaultrcs; 3856 */
3857 if (IS_SET(MODE_REVERSE)) {
3858 g.mode |= ATTR_REVERSE;
3859 g.bg = defaultfg;
3860 if (ena_sel && selected(term.c.x, term.c.y)) {
3861 drawcol = dc.col[defaultcs];
3862 g.fg = defaultrcs;
3863 } else {
3864 drawcol = dc.col[defaultrcs];
3865 g.fg = defaultcs;
3866 }
3857 } else { 3867 } else {
3858 drawcol = dc.col[defaultcs]; 3868 g.fg = defaultfg;
3869 if (ena_sel && selected(term.c.x, term.c.y)) {
3870 g.bg = defaultcs;
3871 drawcol = dc.col[defaultrcs];
3872 } else {
3873 drawcol = dc.col[defaultcs];
3874 g.bg = defaultrcs;
3875 }
3859 } 3876 }
3860 3877
3861 if (IS_SET(MODE_HIDE)) 3878 if (IS_SET(MODE_HIDE))
@@ -3869,12 +3886,6 @@ xdrawcursor(void)
3869 case 0: /* Blinking Block */ 3886 case 0: /* Blinking Block */
3870 case 1: /* Blinking Block (Default) */ 3887 case 1: /* Blinking Block (Default) */
3871 case 2: /* Steady Block */ 3888 case 2: /* Steady Block */
3872 if (IS_SET(MODE_REVERSE)) {
3873 g.mode |= ATTR_REVERSE;
3874 g.fg = defaultcs;
3875 g.bg = defaultfg;
3876 }
3877
3878 g.mode |= term.line[term.c.y][curx].mode & ATTR_WIDE; 3889 g.mode |= term.line[term.c.y][curx].mode & ATTR_WIDE;
3879 xdrawglyph(g, term.c.x, term.c.y); 3890 xdrawglyph(g, term.c.x, term.c.y);
3880 break; 3891 break;