- if (!switching_desks) {
- if (!config_get("focusFollowsMouse", Config_Bool, &focus_follow))
- g_assert_not_reached();
- if (focus_follow.bool)
- fallback = !focus_under_pointer();
+ /* unfocus any focused clients.. they can be focused by Pointer events
+ and such, and then when I try focus them, I won't get a FocusIn event
+ at all for them.
+ */
+ focus_set_client(NULL);
+
+ if (switching_desks) {
+ /* don't skip any windows when switching desktops */
+ old = NULL;
+ } else {
+ if (focus_follow)
+ under = focus_under_pointer();