diff options
author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-08-30 15:28:29 +0200 |
---|---|---|
committer | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-08-30 15:28:29 +0200 |
commit | 326586ba434fb873ebdb81f385ebe838419a98a7 (patch) | |
tree | c20e97feed9a96266a12f5cbb16888734e49e506 | |
parent | ae5baac932af877cb18df6853d45f033ed9b270f (diff) | |
download | st-326586ba434fb873ebdb81f385ebe838419a98a7.tar.gz st-326586ba434fb873ebdb81f385ebe838419a98a7.zip |
cursor is hid when unfocused.
-rw-r--r-- | config.h | 2 | ||||
-rw-r--r-- | st.c | 3 |
2 files changed, 3 insertions, 2 deletions
@@ -1,7 +1,7 @@ | |||
1 | #define TAB 8 | 1 | #define TAB 8 |
2 | #define TNAME "st-256color" | 2 | #define TNAME "st-256color" |
3 | #define FONT "6x13" | 3 | #define FONT "6x13" |
4 | #define BOLDFONT FONT"bold" | 4 | #define BOLDFONT "6x13bold" |
5 | #define BORDER 2 | 5 | #define BORDER 2 |
6 | 6 | ||
7 | /* Terminal colors */ | 7 | /* Terminal colors */ |
@@ -1129,7 +1129,7 @@ xdrawcursor(void) { | |||
1129 | xclear(oldx, oldy, oldx, oldy); | 1129 | xclear(oldx, oldy, oldx, oldy); |
1130 | 1130 | ||
1131 | /* draw the new one */ | 1131 | /* draw the new one */ |
1132 | if(!(term.c.state & CURSOR_HIDE)) { | 1132 | if(!(term.c.state & CURSOR_HIDE) && xw.hasfocus) { |
1133 | xdraws(&g.c, g, term.c.x, term.c.y, 1); | 1133 | xdraws(&g.c, g, term.c.x, term.c.y, 1); |
1134 | oldx = term.c.x, oldy = term.c.y; | 1134 | oldx = term.c.x, oldy = term.c.y; |
1135 | } | 1135 | } |
@@ -1216,6 +1216,7 @@ void | |||
1216 | focus(XEvent *ev) { | 1216 | focus(XEvent *ev) { |
1217 | if((xw.hasfocus = ev->type == FocusIn)) | 1217 | if((xw.hasfocus = ev->type == FocusIn)) |
1218 | xseturgency(0); | 1218 | xseturgency(0); |
1219 | draw(SCREEN_UPDATE); | ||
1219 | } | 1220 | } |
1220 | 1221 | ||
1221 | char* | 1222 | char* |