diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-04-22 19:13:38 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-04-22 19:13:38 +0000 |
| commit | bfb800c032e1dd50f5d1c37d1ce8ac9239947b01 (patch) | |
| tree | 9729cf672c6490618f39926729fc5379cea41864 /openbox/action.c | |
| parent | 7d1226c57cbe2c83d87174b637bcf923897f8033 (diff) | |
a) remove focus_hilite, it is not needed and complicated things
b) set focus_client to null when nothing is actually focused, but still allow
focus to go to black holes
c) allow the focus action to be performed without a client, this will focus
the openbox instance (i.e. the screen in multihead setups)
big thanks to syscrash for the ideas on how to go about this
Diffstat (limited to 'openbox/action.c')
| -rw-r--r-- | openbox/action.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/openbox/action.c b/openbox/action.c index 5e42b68b..db49f56c 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -434,6 +434,11 @@ void setup_action_showmenu(ObAction **a, ObUserAction uact) } } +void setup_action_focus(ObAction **a, ObUserAction uact) +{ + (*a)->data.any.client_action = OB_CLIENT_ACTION_OPTIONAL; +} + void setup_client_action(ObAction **a, ObUserAction uact) { (*a)->data.any.client_action = OB_CLIENT_ACTION_ALWAYS; @@ -494,7 +499,7 @@ ActionString actionstrings[] = { "focus", action_focus, - setup_client_action + setup_action_focus }, { "unfocus", @@ -1159,15 +1164,22 @@ void action_activate(union ActionData *data) void action_focus(union ActionData *data) { - /* similar to the openbox dock for dockapps, don't let user actions give - focus to 3rd-party docks (panels) either (unless they ask for it - themselves). */ - if (data->client.any.c->type != OB_CLIENT_TYPE_DOCK) { - /* if using focus_delay, stop the timer now so that focus doesn't go - moving on us */ - event_halt_focus_delay(); + if (data->client.any.c) { + /* similar to the openbox dock for dockapps, don't let user actions + give focus to 3rd-party docks (panels) either (unless they ask for + it themselves). */ + if (data->client.any.c->type != OB_CLIENT_TYPE_DOCK) { + /* if using focus_delay, stop the timer now so that focus doesn't + go moving on us */ + event_halt_focus_delay(); - client_focus(data->client.any.c); + client_focus(data->client.any.c); + } + } else { + /* focus action on something other than a client, make keybindings + work for this openbox instance, but don't focus any specific client + */ + focus_nothing(); } } |
