From c5aa2746107f338ba3d695c0635031de9fb0e32c Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Fri, 30 Apr 2010 13:17:33 +0000 Subject: [PATCH] Add code for 'focus forward' in the policy. SVN revision: 48469 --- src/modules/illume2/policies/illume/policy.c | 43 +++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/modules/illume2/policies/illume/policy.c b/src/modules/illume2/policies/illume/policy.c index 138107d..80806be 100644 --- a/src/modules/illume2/policies/illume/policy.c +++ b/src/modules/illume2/policies/illume/policy.c @@ -1523,7 +1523,48 @@ _policy_focus_back(E_Zone *zone) void _policy_focus_forward(E_Zone *zone) { -// printf("Focus forward\n"); + Eina_List *l, *fl = NULL; + E_Border *bd, *fbd; + + if (eina_list_count(_pol_focus_stack) < 1) return; + + // printf("Focus forward\n"); + + EINA_LIST_FOREACH(_pol_focus_stack, l, bd) + { + if (bd->zone != zone) continue; + fl = eina_list_append(fl, bd); + } + + fbd = e_border_focused_get(); + if (fbd) + { + if (fbd->parent) return; + } + + EINA_LIST_FOREACH(fl, l, bd) + { + if ((fbd) && (bd == fbd)) + { + E_Border *b; + + if ((l->next) && (b = l->next->data)) + { + _policy_border_set_focus(b); + break; + } + else + { + /* we've reached the end of the list. Set focus to first */ + if (b = eina_list_nth(fl, 0)) + { + _policy_border_set_focus(b); + break; + } + } + } + } + eina_list_free(fl); } void -- 2.7.4