add the notion of "application windows" meaning normal or dialog type windows. let you alt-tab to non-application windows when they dont have an application window in their group
Dana Jansens danakj@orodu.net
3 files changed,
28 insertions(+),
1 deletions(-)
M
openbox/client.c
→
openbox/client.c
@@ -2198,6 +2198,12 @@ self->type == OB_CLIENT_TYPE_DOCK ||
self->type == OB_CLIENT_TYPE_SPLASH); } +gboolean client_application(ObClient *self) +{ + return (self->type == OB_CLIENT_TYPE_NORMAL || + self->type == OB_CLIENT_TYPE_DIALOG); +} + static void client_apply_startup_state(ObClient *self, gint x, gint y) { gboolean pos = FALSE; /* has the window's position been configured? */@@ -3633,3 +3639,17 @@ gboolean client_has_group_siblings(ObClient *self)
{ return self->group && self->group->members->next; } + +gboolean client_has_application_group_siblings(ObClient *self) +{ + GSList *it; + + if (!self->group) return FALSE; + + for (it = self->group->members; it; it = g_slist_next(it)) { + ObClient *c = it->data; + if (c != self && client_application(c)) + return TRUE; + } + return FALSE; +}
M
openbox/client.h
→
openbox/client.h
@@ -348,6 +348,11 @@ Some windows (desktops, docks, splash screens) have special rules applied
to them in a number of places regarding focus or user interaction. */ gboolean client_normal(ObClient *self); +/*! Returns if the window is one of an application's main windows (normal or + dialog type) rather than an accessory window (utilty, menu, etc) or a + non-normal window */ +gboolean client_application(ObClient *self); + /* Returns if the window is focused */ gboolean client_focused(ObClient *self);@@ -660,5 +665,7 @@
ObClient* client_under_pointer(); gboolean client_has_group_siblings(ObClient *self); + +gboolean client_has_application_group_siblings(ObClient *self); #endif
M
openbox/focus.c
→
openbox/focus.c
@@ -475,7 +475,7 @@ ok = ft->type == OB_CLIENT_TYPE_DOCK;
else ok = (ft->type == OB_CLIENT_TYPE_NORMAL || ft->type == OB_CLIENT_TYPE_DIALOG || - (!client_has_group_siblings(ft) && + (!client_has_application_group_siblings(ft) && (ft->type == OB_CLIENT_TYPE_TOOLBAR || ft->type == OB_CLIENT_TYPE_MENU || ft->type == OB_CLIENT_TYPE_UTILITY)));