From a82f5c99c4440d9ece2750d76800b23c290279c2 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 17 Feb 2011 10:55:59 +0000 Subject: [PATCH] fix some design and policy issues so it's simple and sane tyo write a new home screen and softkey - looking at indicator next. SVN revision: 57119 --- src/modules/illume2/e_mod_policy.c | 26 +++++++++++++++----- src/modules/illume2/policies/illume/policy.c | 13 +++++++--- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/modules/illume2/e_mod_policy.c b/src/modules/illume2/e_mod_policy.c index 7febe60e9..ae4046012 100644 --- a/src/modules/illume2/e_mod_policy.c +++ b/src/modules/illume2/e_mod_policy.c @@ -380,6 +380,20 @@ _e_mod_policy_cb_zone_move_resize(void *data __UNUSED__, int type __UNUSED__, vo return ECORE_CALLBACK_PASS_ON; } +static E_Zone * +_e_mod_zone_win_get(Ecore_X_Window win) +{ + E_Zone *zone = NULL; + E_Border *bd; + + if (!(bd = e_border_find_by_client_window(win))) + { + if (!(zone = e_util_zone_window_find(win))) return NULL; + } + else if (bd->zone) zone = bd->zone; + return zone; +} + static Eina_Bool _e_mod_policy_cb_client_message(void *data __UNUSED__, int type __UNUSED__, void *event) { @@ -397,8 +411,8 @@ _e_mod_policy_cb_client_message(void *data __UNUSED__, int type __UNUSED__, void else if (ev->message_type == ECORE_X_ATOM_E_ILLUME_MODE) { E_Zone *zone; - - if (!(zone = e_util_zone_window_find(ev->win))) return ECORE_CALLBACK_PASS_ON; + + if (!(zone = _e_mod_zone_win_get(ev->win))) return ECORE_CALLBACK_PASS_ON; if ((_policy) && (_policy->funcs.zone_mode_change)) _policy->funcs.zone_mode_change(zone, ev->data.l[0]); } @@ -406,7 +420,7 @@ _e_mod_policy_cb_client_message(void *data __UNUSED__, int type __UNUSED__, void { E_Zone *zone; - if (!(zone = e_util_zone_window_find(ev->win))) return ECORE_CALLBACK_PASS_ON; + if (!(zone = _e_mod_zone_win_get(ev->win))) return ECORE_CALLBACK_PASS_ON; if ((_policy) && (_policy->funcs.zone_close)) _policy->funcs.zone_close(zone); } @@ -414,7 +428,7 @@ _e_mod_policy_cb_client_message(void *data __UNUSED__, int type __UNUSED__, void { E_Zone *zone; - if (!(zone = e_util_zone_window_find(ev->win))) return ECORE_CALLBACK_PASS_ON; + if (!(zone = _e_mod_zone_win_get(ev->win))) return ECORE_CALLBACK_PASS_ON; if ((_policy) && (_policy->funcs.focus_back)) _policy->funcs.focus_back(zone); } @@ -422,7 +436,7 @@ _e_mod_policy_cb_client_message(void *data __UNUSED__, int type __UNUSED__, void { E_Zone *zone; - if (!(zone = e_util_zone_window_find(ev->win))) return ECORE_CALLBACK_PASS_ON; + if (!(zone = _e_mod_zone_win_get(ev->win))) return ECORE_CALLBACK_PASS_ON; if ((_policy) && (_policy->funcs.focus_forward)) _policy->funcs.focus_forward(zone); } @@ -430,7 +444,7 @@ _e_mod_policy_cb_client_message(void *data __UNUSED__, int type __UNUSED__, void { E_Zone *zone; - if (!(zone = e_util_zone_window_find(ev->win))) return ECORE_CALLBACK_PASS_ON; + if (!(zone = _e_mod_zone_win_get(ev->win))) return ECORE_CALLBACK_PASS_ON; if ((_policy) && (_policy->funcs.focus_home)) _policy->funcs.focus_home(zone); } diff --git a/src/modules/illume2/policies/illume/policy.c b/src/modules/illume2/policies/illume/policy.c index 4cafb767c..6af69642f 100644 --- a/src/modules/illume2/policies/illume/policy.c +++ b/src/modules/illume2/policies/illume/policy.c @@ -59,6 +59,11 @@ _policy_border_set_focus(E_Border *bd) /* if the border was hidden due to layout, we need to unhide */ if (!bd->visible) e_illume_border_show(bd); + if ((bd->iconic) && (!bd->lock_user_iconify)) + e_border_uniconify(bd); + + if (!bd->lock_user_stacking) e_border_raise(bd); + /* focus the border */ e_border_focus_set(bd, 1, 1); @@ -367,8 +372,6 @@ _policy_zone_layout_softkey(E_Border *bd, E_Illume_Config_Zone *cz) { int ny; -// printf("\tLayout Softkey\n"); - if (!bd) return; /* grab minimum softkey size */ @@ -393,6 +396,10 @@ _policy_zone_layout_softkey(E_Border *bd, E_Illume_Config_Zone *cz) * So for now, just disable the ny check until this gets sorted out */ // if ((bd->x != bd->zone->x) || (bd->y != ny)) _policy_border_move(bd, bd->zone->x, ny); + // set property for apps to find out they are + ecore_x_e_illume_softkey_geometry_set(bd->zone->black_win, + bd->x, bd->y, + bd->w, bd->h); /* set layer if needed */ if (bd->layer != POL_SOFTKEY_LAYER) @@ -1626,8 +1633,6 @@ _policy_focus_home(E_Zone *zone) { E_Border *bd; -// printf("Focus home\n"); - if (!zone) return; if (!(bd = e_illume_border_home_get(zone))) return; _policy_border_set_focus(bd);