-/* finds the first transient that isn't 'skip' and ensure's that client_normal
- is true for it */
-static ObClient *find_transient_recursive(ObClient *c, ObClient *top,
- ObClient *skip)
-{
- GSList *it;
- ObClient *ret;
-
- for (it = c->transients; it; it = g_slist_next(it)) {
- if (it->data == top) return NULL;
- ret = find_transient_recursive(it->data, top, skip);
- if (ret && ret != skip && client_normal(ret) &&
- client_can_focus(ret) && client_validate(ret))
- return ret;
- if (it->data != skip && client_normal(it->data) &&
- client_can_focus(it->data) && client_validate(it->data))
- return it->data;
- }
- return NULL;
-}
-
-static ObClient* focus_fallback_transient(ObClient *top, ObClient *old)
-{
- ObClient *target = find_transient_recursive(top, top, old);
- if (!target) {
- /* make sure client_normal is true always */
- if (!client_normal(top))
- return NULL;
- target = top; /* no transient, keep the top */
- }
- if (client_can_focus(target))
- return target;
- else
- return NULL;
-}
-