From af113bd3fb7b0b54ceae030de4145816e1c17b94 Mon Sep 17 00:00:00 2001
From: Aurélien Aptel <aurelien.aptel@gmail.com>
Date: Mon, 30 Aug 2010 15:28:29 +0200
Subject: cursor is hid when unfocused.

---
 st.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'st.c')

diff --git a/st.c b/st.c
index f42797f..73121ef 100644
--- a/st.c
+++ b/st.c
@@ -1129,7 +1129,7 @@ xdrawcursor(void) {
 		xclear(oldx, oldy, oldx, oldy);
 	
 	/* draw the new one */
-	if(!(term.c.state & CURSOR_HIDE)) {
+	if(!(term.c.state & CURSOR_HIDE) && xw.hasfocus) {
 		xdraws(&g.c, g, term.c.x, term.c.y, 1);
 		oldx = term.c.x, oldy = term.c.y;
 	}
@@ -1216,6 +1216,7 @@ void
 focus(XEvent *ev) {
 	if((xw.hasfocus = ev->type == FocusIn))
 		xseturgency(0);
+	draw(SCREEN_UPDATE);
 }
 
 char*
-- 
cgit v1.2.3-70-g09d2