JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
cursor is hid when unfocused.
[st.git] / st.c
diff --git a/st.c b/st.c
index 436533c..73121ef 100644 (file)
--- a/st.c
+++ b/st.c
 #include <X11/keysym.h>
 #include <X11/Xutil.h>
 
-#if   defined(LINUX)
+#if   defined(__linux)
  #include <pty.h>
-#elif defined(OPENBSD)
+#elif defined(__OpenBSD__) || defined(__NetBSD__)
  #include <util.h>
-#elif defined(FREEBSD)
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
  #include <libutil.h>
 #endif
 
@@ -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*