diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-04-05 22:20:14 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-04-05 22:20:14 +0000 |
| commit | 7ebc5c797f0435286f25f077e8329ec821fc5e53 (patch) | |
| tree | 99106008e8e8b238a48374c88204608717d936f5 /openbox | |
| parent | 69c9b6211bbfa0211426a511991502bbacd14672 (diff) | |
linear focus cycling of the gods
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/action.c | 16 | ||||
| -rw-r--r-- | openbox/action.h | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/openbox/action.c b/openbox/action.c index 0e41e2eb..fccabfcd 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -1,4 +1,5 @@ #include "client.h" +#include "focus.h" #include "stacking.h" #include "frame.h" #include "screen.h" @@ -666,9 +667,16 @@ void action_showmenu(union ActionData *data) void action_cycle_windows(union ActionData *data) { if (data->cycle.linear) { - if (!data->cycle.final) { + static Client *first = NULL; + static Client *t = NULL; + + if (data->cycle.cancel) { + if (first) client_focus(first); + } else if (!data->cycle.final) { GList *it, *start; + t = NULL; + first = focus_client; start = it = g_list_find(client_list, data->cycle.c); do { if (data->cycle.forward) { @@ -678,9 +686,13 @@ void action_cycle_windows(union ActionData *data) it = it->prev; if (it == NULL) it = g_list_last(client_list); } - if (client_focus(it->data)) + if (client_focus(it->data)) { + t = it->data; break; + } } while (it != start); + } else { + if (t) stacking_raise(t); } } else { } diff --git a/openbox/action.h b/openbox/action.h index 0fe42f64..a5b1708e 100644 --- a/openbox/action.h +++ b/openbox/action.h @@ -73,6 +73,7 @@ struct CycleWindows { gboolean linear; gboolean forward; gboolean final; + gboolean cancel; }; union ActionData { |
