X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus.c;h=4df6662cccc4e95302712acfed3b46661b821c72;hb=52d4433a00751ad2184e58af7fbc31b206c13f59;hp=a462915740c4e60df713021e5c2f38603eb43fe1;hpb=eee483bb472b0d3e95dd2470aa49656653dd13d6;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index a4629157..4df6662c 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -118,24 +118,23 @@ void focus_fallback(gboolean switching_desks) { ConfigValue focus_follow; GList *it; - gboolean fallback = TRUE; + gboolean under = TRUE; if (!switching_desks) { if (!config_get("focusFollowsMouse", Config_Bool, &focus_follow)) g_assert_not_reached(); if (focus_follow.bool) - fallback = !focus_under_pointer(); + under = focus_under_pointer(); } - if (fallback) { + if (!under) { for (it = focus_order[screen_desktop]; it != NULL; it = it->next) if (it->data != focus_client && client_normal(it->data)) { g_message("fallback trying %lx", ((Client*)it->data)->window); if (client_focus(it->data)) break; } + if (it == NULL) /* nothing to focus */ + focus_set_client(NULL); } - - if (it == NULL) /* nothing to focus */ - focus_set_client(NULL); }