A few changes to make this more robust.

I am able to get stuck in window management mode without ctrl+alt
held down somehow but it's not reproducable. These changes should
hopefully make this a bit more robust.
Check kAcceptKeyboardFocusFlag first.