From f45709a73a9111169d4aee1bb4843b37ddc73ecf Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 17 Feb 2011 13:06:53 +0000 Subject: [PATCH] and fill in policy holes with handling transitions to/from fullscreen etc. SVN revision: 57125 --- src/modules/illume2/policies/illume/policy.c | 106 ++++++++++++++++--- 1 file changed, 92 insertions(+), 14 deletions(-) diff --git a/src/modules/illume2/policies/illume/policy.c b/src/modules/illume2/policies/illume/policy.c index 5bb101926..06bff4f53 100644 --- a/src/modules/illume2/policies/illume/policy.c +++ b/src/modules/illume2/policies/illume/policy.c @@ -159,6 +159,7 @@ _policy_border_hide_below(E_Border *bd) if (e_illume_border_is_softkey(b)) continue; if (e_illume_border_is_keyboard(b)) continue; if (e_illume_border_is_quickpanel(b)) continue; + if (e_illume_border_is_home(b)) continue; if ((bd->fullscreen) || (bd->need_fullscreen)) { @@ -224,6 +225,7 @@ _policy_border_show_below(E_Border *bd) if (e_illume_border_is_softkey(b)) continue; if (e_illume_border_is_keyboard(b)) continue; if (e_illume_border_is_quickpanel(b)) continue; + if (e_illume_border_is_home(b)) continue; if ((bd->fullscreen) || (bd->need_fullscreen)) { @@ -288,12 +290,19 @@ _policy_zone_layout_indicator(E_Border *bd, E_Illume_Config_Zone *cz) e_illume_border_min_get(bd, NULL, &cz->indicator.size); /* no point in doing anything here if indicator is hidden */ - if ((!bd->new_client) && (!bd->visible)) return; + if ((!bd->new_client) && (!bd->visible)) + { + ecore_x_e_illume_indicator_geometry_set(bd->zone->black_win, + 0, 0, 0, 0); + return; + } /* if we are dragging, then skip it for now */ if (bd->client.illume.drag.drag) { /* when dragging indicator, we need to trigger a layout update */ + ecore_x_e_illume_indicator_geometry_set(bd->zone->black_win, + 0, 0, 0, 0); _policy_zone_layout_update(bd->zone); return; } @@ -381,7 +390,12 @@ _policy_zone_layout_softkey(E_Border *bd, E_Illume_Config_Zone *cz) e_illume_border_min_get(bd, NULL, &cz->softkey.size); /* no point in doing anything here if softkey is hidden */ - if (!bd->visible) return; + if (!bd->visible) + { + ecore_x_e_illume_softkey_geometry_set(bd->zone->black_win, + 0, 0, 0, 0); + return; + } /* if we are dragging, then skip it for now */ /* NB: Disabled currently until we confirm that softkey should be draggable */ @@ -446,24 +460,36 @@ _policy_zone_layout_keyboard(E_Border *bd, E_Illume_Config_Zone *cz) static void _policy_zone_layout_home_single(E_Border *bd, E_Illume_Config_Zone *cz) { - int ny, nh; + int ny, nh, indsz = 0, sftsz = 0; + E_Border *ind, *sft; if ((!bd) || (!cz)) return; /* no point in adjusting size or position if it's not visible */ if (!bd->visible) return; -// printf("\tLayout Home Single: %s\n", bd->client.icccm.class); + printf("\tLayout Home Single: %s\n", bd->client.icccm.class); + indsz = cz->indicator.size; + sftsz = cz->softkey.size; + if ((ind = e_illume_border_indicator_get(bd->zone))) + { + if (!ind->visible) indsz = 0; + } + if ((sft = e_illume_border_softkey_get(bd->zone))) + { + if (!sft->visible) sftsz = 0; + } /* make sure it's the required width & height */ if (e_illume_border_is_conformant(bd)) nh = bd->zone->h; - else nh = (bd->zone->h - cz->indicator.size - cz->softkey.size); + else nh = (bd->zone->h - indsz - sftsz); + if ((bd->w != bd->zone->w) || (bd->h != nh)) _policy_border_resize(bd, bd->zone->w, nh); /* move to correct position (relative to zone) if needed */ if (e_illume_border_is_conformant(bd)) ny = bd->zone->y; - else ny = (bd->zone->y + cz->indicator.size); + else ny = (bd->zone->y + indsz); if ((bd->x != bd->zone->x) || (bd->y != ny)) _policy_border_move(bd, bd->zone->x, ny); @@ -474,17 +500,27 @@ _policy_zone_layout_home_single(E_Border *bd, E_Illume_Config_Zone *cz) static void _policy_zone_layout_home_dual_top(E_Border *bd, E_Illume_Config_Zone *cz) { - E_Border *home; - int ny, nh; + E_Border *home, *ind, *sft; + int ny, nh, indsz = 0, sftsz = 0; if ((!bd) || (!cz)) return; /* no point in adjusting size or position if it's not visible */ if (!bd->visible) return; + indsz = cz->indicator.size; + sftsz = cz->softkey.size; + if ((ind = e_illume_border_indicator_get(bd->zone))) + { + if (!ind->visible) indsz = 0; + } + if ((sft = e_illume_border_softkey_get(bd->zone))) + { + if (!sft->visible) sftsz = 0; + } /* set some defaults */ - ny = (bd->zone->y + cz->indicator.size); - nh = ((bd->zone->h - cz->indicator.size - cz->softkey.size) / 2); + ny = (bd->zone->y + indsz); + nh = ((bd->zone->h - indsz - sftsz) / 2); /* see if there are any other home windows */ home = e_illume_border_home_get(bd->zone); @@ -585,7 +621,7 @@ _policy_zone_layout_fullscreen(E_Border *bd) { int kh; -// printf("\tLayout Fullscreen: %s\n", bd->client.icccm.name); + printf("\tLayout Fullscreen: %s\n", bd->client.icccm.name); if (!bd) return; @@ -1024,7 +1060,7 @@ _policy_border_add(E_Border *bd) * but we save ourselves a function call this way */ if ((bd->fullscreen) || (bd->need_fullscreen)) { - E_Border *ind; + E_Border *ind, *sft; /* try to get the Indicator on this zone */ if ((ind = e_illume_border_indicator_get(bd->zone))) @@ -1032,6 +1068,18 @@ _policy_border_add(E_Border *bd) /* we have the indicator, hide it if needed */ if (ind->visible) e_illume_border_hide(ind); } + /* conformant - may not need softkey */ + if ((sft = e_illume_border_softkey_get(bd->zone))) + { + if (e_illume_border_is_conformant(bd)) + { + if (sft->visible) e_illume_border_hide(sft); + } + else + { + if (!sft->visible) e_illume_border_show(sft); + } + } } /* Add this border to our focus stack if it can accept or take focus */ @@ -1067,6 +1115,7 @@ _policy_border_del(E_Border *bd) /* we have the indicator, show it if needed */ if (!ind->visible) e_illume_border_show(ind); } + _policy_zone_layout_update(bd->zone); } /* remove from our focus stack */ @@ -1101,7 +1150,28 @@ _policy_border_del(E_Border *bd) void _policy_border_focus_in(E_Border *bd __UNUSED__) { + E_Border *ind; + // printf("Border focus in: %s\n", bd->client.icccm.name); + if ((bd->fullscreen) || (bd->need_fullscreen)) + { + /* try to get the Indicator on this zone */ + if ((ind = e_illume_border_indicator_get(bd->zone))) + { + /* we have the indicator, show it if needed */ + if (ind->visible) e_illume_border_hide(ind); + } + } + else + { + /* try to get the Indicator on this zone */ + if ((ind = e_illume_border_indicator_get(bd->zone))) + { + /* we have the indicator, show it if needed */ + if (!ind->visible) e_illume_border_show(ind); + } + } + _policy_zone_layout_update(bd->zone); } void @@ -1674,11 +1744,19 @@ _policy_property_change(Ecore_X_Event_Window_Property *event) * but we save ourselves a function call this way */ if ((bd->fullscreen) || (bd->need_fullscreen)) { - if (ind->visible) e_illume_border_hide(ind); + if (ind->visible) + { + e_illume_border_hide(ind); + _policy_zone_layout_update(bd->zone); + } } else { - if (!ind->visible) e_illume_border_show(ind); + if (!ind->visible) + { + e_illume_border_show(ind); + _policy_zone_layout_update(bd->zone); + } } } else if (event->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY)