aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2012-02-15 19:33:48 +0100
committerAurélien Aptel <aurelien.aptel@gmail.com>2012-02-15 19:33:48 +0100
commitadf5d2e32a74704778e60e71be5425b7d7fff3e2 (patch)
treed4da30d5797e6b9ebece1d3b0348631ac906acfd
parent62d380947ee9fb8a1d5678985b1a729cfd4310b4 (diff)
downloadst-patched-adf5d2e32a74704778e60e71be5425b7d7fff3e2.tar.bz2
st-patched-adf5d2e32a74704778e60e71be5425b7d7fff3e2.tar.xz
st-patched-adf5d2e32a74704778e60e71be5425b7d7fff3e2.zip
show dark cursor when unfocused.
-rw-r--r--TODO7
-rw-r--r--config.def.h10
-rw-r--r--st.c8
3 files changed, 18 insertions, 7 deletions
diff --git a/TODO b/TODO
index 62a9f42..311d9ca 100644
--- a/TODO
+++ b/TODO
@@ -10,10 +10,15 @@ code & interface
10 10
11* clean selection code 11* clean selection code
12* clean and complete terminfo entry 12* clean and complete terminfo entry
13* fix shift up/down (shift selection in emacs)
14* fast drawing 13* fast drawing
15* ... 14* ...
16 15
16bugs
17----
18
19* handle XOpenMI() errors
20* fix shift up/down (shift selection in emacs)
21
17misc 22misc
18---- 23----
19 24
diff --git a/config.def.h b/config.def.h
index f1bd91e..169bcdd 100644
--- a/config.def.h
+++ b/config.def.h
@@ -32,13 +32,15 @@ static const char *colorname[] = {
32 32
33 /* more colors can be added to use with DefaultXX */ 33 /* more colors can be added to use with DefaultXX */
34 "#cccccc", 34 "#cccccc",
35 "#333333",
35}; 36};
36 37
37/* Default colors (colorname index) 38/* Default colors (colorname index)
38 foreground, background, cursor */ 39 foreground, background, cursor, unfocused cursor */
39#define DefaultFG 7 40#define DefaultFG 7
40#define DefaultBG 0 41#define DefaultBG 0
41#define DefaultCS 16 42#define DefaultCS 16
43#define DefaultUCS 17
42 44
43/* Special keys (change & recompile st.info accordingly) 45/* Special keys (change & recompile st.info accordingly)
44 Keep in mind that kpress() in st.c hardcodes some keys. 46 Keep in mind that kpress() in st.c hardcodes some keys.
diff --git a/st.c b/st.c
index 627e566..a86e0f9 100644
--- a/st.c
+++ b/st.c
@@ -1826,10 +1826,14 @@ xdrawcursor(void) {
1826 xcopy(oldx, oldy, 1, 1); 1826 xcopy(oldx, oldy, 1, 1);
1827 1827
1828 /* draw the new one */ 1828 /* draw the new one */
1829 if(!(term.c.state & CURSOR_HIDE) && (xw.state & WIN_FOCUSED)) { 1829 if(!(term.c.state & CURSOR_HIDE)) {
1830 sl = utf8size(g.c); 1830 if(!(xw.state & WIN_FOCUSED))
1831 g.bg = DefaultUCS;
1832
1831 if(IS_SET(MODE_REVERSE)) 1833 if(IS_SET(MODE_REVERSE))
1832 g.mode |= ATTR_REVERSE, g.fg = DefaultCS, g.bg = DefaultFG; 1834 g.mode |= ATTR_REVERSE, g.fg = DefaultCS, g.bg = DefaultFG;
1835
1836 sl = utf8size(g.c);
1833 xdraws(g.c, g, term.c.x, term.c.y, 1, sl); 1837 xdraws(g.c, g, term.c.x, term.c.y, 1, sl);
1834 oldx = term.c.x, oldy = term.c.y; 1838 oldx = term.c.x, oldy = term.c.y;
1835 } 1839 }