From b27bad5c9a08b8d65f5e0e60f19800739501838f Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Tue, 20 Apr 2010 00:06:18 +0000 Subject: [PATCH] Instead of always focusing home when there is a problem showing_below, try to focus the previous border in the focus stack, and if that fails, then focus home (fixed #7 in 'illume2 problems' email). SVN revision: 48153 --- src/modules/illume2/policies/illume/policy.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/illume2/policies/illume/policy.c b/src/modules/illume2/policies/illume/policy.c index 87e7bf4..5bae96b 100644 --- a/src/modules/illume2/policies/illume/policy.c +++ b/src/modules/illume2/policies/illume/policy.c @@ -176,6 +176,7 @@ _policy_border_hide_below(E_Border *bd) static void _policy_border_show_below(E_Border *bd) { + E_Border *prev; int pos = 0, i; // printf("Show Borders Below: %s %d %d\n", @@ -183,11 +184,9 @@ _policy_border_show_below(E_Border *bd) if (bd->client.icccm.transient_for) { - E_Border *trans; - - if (trans = e_border_find_by_client_window(bd->client.icccm.transient_for)) + if (prev = e_border_find_by_client_window(bd->client.icccm.transient_for)) { - _policy_border_set_focus(trans); + _policy_border_set_focus(prev); return; } } @@ -239,8 +238,10 @@ _policy_border_show_below(E_Border *bd) } /* if we reach here, then there is a problem with showing a window below - * this one, so show home */ - _policy_focus_home(bd->zone); + * this one, so show previous window in stack */ + prev = eina_list_data_get(eina_list_last(_pol_focus_stack)); + if (prev) _policy_border_set_focus(prev); + else _policy_focus_home(bd->zone); } static void -- 2.7.4