gboolean clientIsTransientOrModal (Client * c) { g_return_val_if_fail (c != NULL, FALSE); TRACE ("entering clientIsTransientOrModal"); return (clientIsTransient(c) || clientIsModal(c)); }
static GList * clientCycleCreateList (Client *c) { ScreenInfo *screen_info; Client *c2; guint range, search_range, i; GList *client_list; g_return_val_if_fail (c, NULL); TRACE ("client \"%s\" (0x%lx)", c->name, c->window); screen_info = c->screen_info; range = clientGetCycleRange (screen_info); client_list = NULL; for (c2 = c, i = 0; c && i < screen_info->client_count; i++, c2 = c2->next) { search_range = range; /* * We want to include modals even if skip pager/taskbar because * modals are supposed to be focused */ if (clientIsModal(c2)) { search_range |= (SEARCH_INCLUDE_SKIP_TASKBAR | SEARCH_INCLUDE_SKIP_PAGER); } if (!clientSelectMask (c2, NULL, search_range, WINDOW_REGULAR_FOCUSABLE)) { TRACE ("%s not in select mask", c2->name); continue; } if (screen_info->params->cycle_apps_only) { /* * For apps only cycling, it's a tad more complicated * - We want "fake" dialogs, ie without a parent window * - We do not want dialogs but we want modals * - If a modal was added,we do not want to add * its parent again */ if (c2->type & WINDOW_TYPE_DIALOG) { if (clientIsValidTransientOrModal (c2)) { if (!clientIsModal(c2)) { TRACE ("%s is not modal", c2->name); continue; } } } else if (!(c2->type & WINDOW_NORMAL)) { { TRACE ("%s is not normal", c2->name); continue; } } else { if (g_list_find_custom (client_list, c2, clientCompareModal)) { TRACE ("%s found as modal list", c2->name); continue; } } } TRACE ("adding %s", c2->name); client_list = g_list_append (client_list, c2); } return client_list; }