In the situation you kill a client and it happens the cursor lands in the root window no window has focus. Then you Alt-Tab to cycle and the window which gets the pointer is not the last focused but the previous one.
Index: client.c =================================================================== RCS file: /cvs/xenocara/app/cwm/client.c,v retrieving revision 1.255 diff -u -p -r1.255 client.c --- client.c 7 Mar 2019 14:28:17 -0000 1.255 +++ client.c 1 May 2019 13:04:04 -0000 @@ -722,7 +722,16 @@ client_cycle(struct screen_ctx *sc, int newcc->ptr.x = newcc->geom.w / 2; newcc->ptr.y = newcc->geom.h / 2; } - client_ptrwarp(newcc); + + /* When no client is active warp pointer to last active */ + if (oldcc->flags & (CLIENT_ACTIVE)) + client_ptrwarp(newcc); + else if (oldcc->flags & (CLIENT_SKIP_CYCLE)) + client_ptrwarp(newcc); + else { + client_raise(oldcc); + client_ptrwarp(oldcc); + } } static struct client_ctx *