Hi Currently, st sets its focus based on both FocusIn and EnterNotify XEvents and uses this focus to decide whether to draw the cursor. This causes a problem for window managers that don't use _focus follows pointer_ because it is then possible for st to have the keyboard focus but not be drawing the cursor.
The obvious fix is to simply remove the EnterNotify and LeaveNotify events. I have attached a patch that does so. I've tested this lightly in several window managers (tiling and non-tiling, various focus models) and it seems to have the desired effect. Adrian
diff -r 1c8e6796c6fe st.c --- a/st.c Sun Aug 14 17:15:19 2011 +0200 +++ b/st.c Sat Sep 03 17:22:08 2011 +0100 @@ -243,8 +243,6 @@ [VisibilityNotify] = visibility, [UnmapNotify] = unmap, [Expose] = expose, - [EnterNotify] = focus, - [LeaveNotify] = focus, [FocusIn] = focus, [FocusOut] = focus, [MotionNotify] = bmotion,