X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus.c;h=8b4b66e465853e47730a9978d543cc3bd800619f;hb=0352abfa88892bc17bdff2022745e3c1b312edd0;hp=a75c170f649e72bf62c07456e603742e976e1229;hpb=965ed8907a5dd81d5ffbc93b67a672fa78833854;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index a75c170f..8b4b66e4 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -129,7 +129,8 @@ static ObClient* focus_fallback_target(gboolean allow_refocus, 3. it is not shaded */ if ((allow_omnipresent || c->desktop == screen_desktop) && - focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) && + focus_valid_target(c, screen_desktop, + TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) && !c->shaded && (allow_refocus || client_focus_target(c) != old) && client_focus(c)) @@ -149,7 +150,8 @@ static ObClient* focus_fallback_target(gboolean allow_refocus, a splashscreen or a desktop window (save the desktop as a backup fallback though) */ - if (focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) && + if (focus_valid_target(c, screen_desktop, + TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) && (allow_refocus || client_focus_target(c) != old) && client_focus(c)) { @@ -273,7 +275,8 @@ static gboolean focus_target_has_siblings(ObClient *ft, ObClient *c = it->data; /* check that it's not a helper window to avoid infinite recursion */ if (c != ft && c->type == OB_CLIENT_TYPE_NORMAL && - focus_valid_target(c, TRUE, iconic_windows, all_desktops, + focus_valid_target(c, screen_desktop, + TRUE, iconic_windows, all_desktops, FALSE, FALSE, FALSE)) { return TRUE; @@ -283,6 +286,7 @@ static gboolean focus_target_has_siblings(ObClient *ft, } gboolean focus_valid_target(ObClient *ft, + guint desktop, gboolean helper_windows, gboolean iconic_windows, gboolean all_desktops, @@ -296,7 +300,7 @@ gboolean focus_valid_target(ObClient *ft, do this check first because it will usually filter out the most windows */ - ok = (all_desktops || ft->desktop == screen_desktop || + ok = (all_desktops || ft->desktop == desktop || ft->desktop == DESKTOP_ALL); /* the window can receive focus somehow */ @@ -328,9 +332,10 @@ gboolean focus_valid_target(ObClient *ft, /* it's not set to skip the taskbar (but this only applies to normal typed windows, and is overridden if the window is modal or if the user asked - for this window to be focused) */ + for this window to be focused, or if the window is iconified) */ ok = ok && (ft->type != OB_CLIENT_TYPE_NORMAL || ft->modal || + ft->iconic || user_request || !ft->skip_taskbar); @@ -340,6 +345,7 @@ gboolean focus_valid_target(ObClient *ft, { ObClient *cft = client_focus_target(ft); ok = ok && (ft == cft || !focus_valid_target(cft, + screen_desktop, TRUE, iconic_windows, all_desktops,