X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus.c;h=393ec98eaf0e0b3bd478df5b8b034e66c806e190;hb=d3ecb7c127edc6fd16059f786818bde71b9540a7;hp=80cd0b080affecc29f00e8b10272ddcfe0040a9e;hpb=1e4215c5c63c53c199a3a5a177607de308c8a3f1;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index 80cd0b08..393ec98e 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -255,7 +255,7 @@ ObClient* focus_fallback_target(gboolean allow_refocus, ObClient *old) return desktop; } -void focus_fallback(gboolean allow_refocus) +ObClient* focus_fallback(gboolean allow_refocus) { ObClient *new; ObClient *old = focus_client; @@ -266,8 +266,11 @@ void focus_fallback(gboolean allow_refocus) */ focus_nothing(); - if ((new = focus_fallback_target(allow_refocus, old))) + if ((new = focus_fallback_target(allow_refocus, old))) { client_focus(new); + return new; + } else + return NULL; } void focus_nothing() @@ -539,8 +542,8 @@ static gboolean has_valid_group_siblings_on_desktop(ObClient *ft, for (it = ft->group->members; it; it = g_slist_next(it)) { ObClient *c = it->data; /* check that it's not a helper window to avoid infinite recursion */ - if (c != ft && !client_helper(ft) && - valid_focus_target(ft, all_desktops, FALSE)) + if (c != ft && !client_helper(c) && + valid_focus_target(c, all_desktops, FALSE)) { return TRUE; }