summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-05 01:37:51 +0000
committerDana Jansens <danakj@orodu.net>2007-05-05 01:37:51 +0000
commit03f861b0ac70450359656ad16c754e9e394d6c49 (patch)
treebb6302ece3af8ceed96c77ef022b6c021a0c1f38 /openbox
parentfce7d9b21ed039f32cde5f4fb6caa179e8c7e922 (diff)
let you alt-tab to utility windows when focus is already in the group
Diffstat (limited to 'openbox')
-rw-r--r--openbox/focus.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/openbox/focus.c b/openbox/focus.c
index b1e31236..73b0e787 100644
--- a/openbox/focus.c
+++ b/openbox/focus.c
@@ -475,13 +475,20 @@ static gboolean valid_focus_target(ObClient *ft, gboolean dock_windows)
else
ok = (ft->type == OB_CLIENT_TYPE_NORMAL ||
ft->type == OB_CLIENT_TYPE_DIALOG ||
- (!client_has_application_group_siblings(ft) &&
- (ft->type == OB_CLIENT_TYPE_TOOLBAR ||
- ft->type == OB_CLIENT_TYPE_MENU ||
- ft->type == OB_CLIENT_TYPE_UTILITY)));
+ (ft->type == OB_CLIENT_TYPE_TOOLBAR ||
+ ft->type == OB_CLIENT_TYPE_MENU ||
+ ft->type == OB_CLIENT_TYPE_UTILITY) &&
+ /* let alt-tab go to these windows when a window in its group
+ already has focus ... */
+ ((focus_client && ft->group == focus_client->group) ||
+ /* ... or if there are no application windows in its group */
+ !client_has_application_group_siblings(ft)));
ok = ok && (ft->can_focus || ft->focus_notify);
- if (!dock_windows) /* use dock windows that skip taskbar too */
- ok = ok && !ft->skip_taskbar;
+ if (!dock_windows && /* use dock windows that skip taskbar too */
+ !(ft->type == OB_CLIENT_TYPE_TOOLBAR || /* also, if we actually are */
+ ft->type == OB_CLIENT_TYPE_MENU || /* being allowed to target */
+ ft->type == OB_CLIENT_TYPE_UTILITY)) /* one of these, don't let */
+ ok = ok && !ft->skip_taskbar; /* skip taskbar stop us */
ok = ok && (ft->desktop == screen_desktop || ft->desktop == DESKTOP_ALL);
ok = ok && ft == client_focus_target(ft);
return ok;