all repos — openbox @ 1139d96e7f109158e27a0605f4de94ccceb41c55

openbox fork - make it a bit more like ryudo

better focus cycling for transients. use the parent instead of the transients in the list in case it has more than one, then after choosing it try focus a transient instead
Dana Jansens danakj@orodu.net
commit

1139d96e7f109158e27a0605f4de94ccceb41c55

parent

0ce054c2b5f85e4e71b274bbe83fca2be61a1baf

1 files changed, 18 insertions(+), 9 deletions(-)

jump to
M openbox/focus.copenbox/focus.c

@@ -230,7 +230,7 @@ checks for this is in transient/group fallbacks, so they can

be fallback targets there. */ !((Client*)it->data)->fullscreen && client_can_focus(it->data)) { - gboolean r = client_focus(sit->data); + gboolean r = client_focus(it->data); assert(r); return; }

@@ -257,10 +257,6 @@ /* XXX the size and the font extents need to be related on some level

*/ popup_size(focus_cycle_popup, 320, 48); - /* use the transient's parent's title/icon */ - while (c->transient_for && c->transient_for != TRAN_GROUP) - c = c->transient_for; - popup_show(focus_cycle_popup, (c->iconic ? c->icon_title : c->title), client_icon(c, 48, 48)); }

@@ -282,8 +278,22 @@ if (focus_client)

frame_adjust_focus(focus_client->frame, TRUE); goto done_cycle; } else if (done) { - if (focus_cycle_target) + if (focus_cycle_target) { + Client *t; + + /* actually focus a transient */ + + /* fist, try for a modal */ + t = client_focus_target(focus_cycle_target); + if (t != focus_cycle_target) + focus_cycle_target = t; + else + /* just grab the deepest transient you can find */ + while (focus_cycle_target->transients) + focus_cycle_target = focus_cycle_target->transients->data; + client_activate(focus_cycle_target); + } goto done_cycle; } if (!first)

@@ -310,9 +320,8 @@ if (it == NULL) it = g_list_last(list);

} /*ft = client_focus_target(it->data);*/ ft = it->data; - if (ft->transients == NULL && /*ft == it->data &&*/client_normal(ft) && - (ft->can_focus || ft->focus_notify) && - (ft->desktop == screen_desktop || ft->desktop == DESKTOP_ALL)) { + if (ft->transient_for == NULL && client_normal(ft) && + client_can_focus(ft)) { if (ft != focus_cycle_target) { /* prevents flicker */ if (focus_cycle_target) frame_adjust_focus(focus_cycle_target->frame, FALSE);