Change approach to avoid window focus during grabs.
!2776 (merged) unfortunately introduced some issues during alt-tab (at least on a Wayland session) since the window focus changes do happen at a time that a grab still exists for the switcher popup. This MR does a partial revert and attempts a different approach at a lower level, the particular difference being that the X11 input focus is synchronized after grabs are abandoned.