From 079e359107d255d678dfc225f8ed44d6bb581d31 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 8 May 2007 18:26:00 +0000 Subject: [PATCH] let you nextwindow to helper windows if they ar the only thing on the desktop --- openbox/client.c | 14 -------------- openbox/client.h | 4 ---- openbox/focus.c | 23 ++++++++++++++++++++++- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 529049a8..e2b2636b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3888,17 +3888,3 @@ gboolean client_has_group_siblings(ObClient *self) { return self->group && self->group->members->next; } - -gboolean client_has_non_helper_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_normal(c) && !client_helper(c)) - return TRUE; - } - return FALSE; -} diff --git a/openbox/client.h b/openbox/client.h index ede581a7..5fb26262 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -661,8 +661,4 @@ ObClient* client_under_pointer(); gboolean client_has_group_siblings(ObClient *self); -/*! Returns if a client has an group siblings which are main application - windows (not helper or non-normal windows) */ -gboolean client_has_non_helper_group_siblings(ObClient *self); - #endif diff --git a/openbox/focus.c b/openbox/focus.c index b473686a..71d22026 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -528,6 +528,25 @@ void focus_cycle_draw_indicator() } } +static gboolean has_non_helper_group_siblings_on_desktop(ObClient *ft, + gboolean all_desktops) +{ + GSList *it; + + if (!ft->group) return FALSE; + + for (it = ft->group->members; it; it = g_slist_next(it)) { + ObClient *c = it->data; + if (c != ft && client_normal(c) && !client_helper(c) && + (c->desktop == ft->desktop || c->desktop == DESKTOP_ALL || + all_desktops)) + { + return TRUE; + } + } + return FALSE; +} + static gboolean valid_focus_target(ObClient *ft, gboolean all_desktops, gboolean dock_windows) @@ -557,7 +576,9 @@ static gboolean valid_focus_target(ObClient *ft, group already has focus ... */ ((focus_client && ft->group == focus_client->group) || /* ... or if there are no main windows in its group */ - !client_has_non_helper_group_siblings(ft)))); + !has_non_helper_group_siblings_on_desktop(ft, + all_desktops)) + )); /* it's not set to skip the taskbar (unless it is a type that would be expected to set this hint */ -- 2.34.1