diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-04-08 01:03:26 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-04-08 01:03:26 +0000 |
| commit | f278ec41e4c310da218563e7d443df32783e26e4 (patch) | |
| tree | 4132f4bebfacfb7b0956fbe49a7185f909197ac9 /openbox/focus.c | |
| parent | fc32577766755a84ac883b4d862fab3c5e681642 (diff) | |
fallback to transients' parents when possible.
return the Client* which was focused from focus_cycle
Diffstat (limited to 'openbox/focus.c')
| -rw-r--r-- | openbox/focus.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/openbox/focus.c b/openbox/focus.c index cf6e7b51..b0cd735d 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -3,6 +3,7 @@ #include "client.h" #include "frame.h" #include "screen.h" +#include "group.h" #include "prop.h" #include "dispatch.h" #include "focus.h" @@ -185,6 +186,21 @@ void focus_fallback(gboolean switching_desks) return; } + if (old && old->transient_for) { + if (old->transient_for == TRAN_GROUP) { + for (it = focus_order[screen_desktop]; it != NULL; it = it->next) { + GSList *sit; + + for (sit = old->group->members; sit; sit = sit->next) + if (sit->data == it->data && client_focus(sit->data)) + return; + } + } else { + if (client_focus(old->transient_for)) + return; + } + } + for (it = focus_order[screen_desktop]; it != NULL; it = it->next) if (it->data != old && client_normal(it->data)) if (client_focus(it->data)) @@ -194,7 +210,7 @@ void focus_fallback(gboolean switching_desks) focus_set_client(NULL); } -void focus_cycle(gboolean forward, gboolean linear, gboolean done, +Client *focus_cycle(gboolean forward, gboolean linear, gboolean done, gboolean cancel) { static Client *first = NULL; @@ -235,15 +251,16 @@ void focus_cycle(gboolean forward, gboolean linear, gboolean done, if (ft == it->data && focus_client != ft && client_focusable(ft)) { if (client_focus(ft)) { noreorder++; /* avoid reordering the focus_order */ - break; + return ft; } } } while (it != start); - return; + return NULL; done_cycle: t = NULL; first = NULL; g_list_free(order); order = NULL; + return NULL; } |
