aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/illume2/policies/illume/layout.c
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2010-01-26 20:13:34 +0000
committerChristopher Michael <cpmichael1@comcast.net>2010-01-26 20:13:34 +0000
commiteeb3a3318d6078534e6c45ea377235f5a50a796b (patch)
tree407afa2384f84da0fb1b03050065ea43fe066179 /src/modules/illume2/policies/illume/layout.c
parentf0588f2b2d5e2ef117a90647c840aa720f7efaa0 (diff)
downloadenlightenment-eeb3a3318d6078534e6c45ea377235f5a50a796b.tar.gz
enlightenment-eeb3a3318d6078534e6c45ea377235f5a50a796b.tar.xz
enlightenment-eeb3a3318d6078534e6c45ea377235f5a50a796b.zip
Fix up layout code wrt fullscreen apps, conformant apps, and vkbd.
SVN revision: 45598
Diffstat (limited to 'src/modules/illume2/policies/illume/layout.c')
-rw-r--r--src/modules/illume2/policies/illume/layout.c226
1 files changed, 110 insertions, 116 deletions
diff --git a/src/modules/illume2/policies/illume/layout.c b/src/modules/illume2/policies/illume/layout.c
index 0c26b7225..aef9ac64a 100644
--- a/src/modules/illume2/policies/illume/layout.c
+++ b/src/modules/illume2/policies/illume/layout.c
@@ -206,8 +206,21 @@ _layout_zone_layout(E_Zone *zone)
{
if (cfg_zone->mode.dual) _zone_layout_dual(bd);
else _zone_layout_single(bd);
- if (bd->layer != IL_APP_LAYER)
- e_border_layer_set(bd, IL_APP_LAYER);
+ if (e_illume_border_is_conformant(bd))
+ {
+ if (bd->layer != IL_CONFORM_LAYER)
+ e_border_layer_set(bd, IL_CONFORM_LAYER);
+ }
+ else if ((bd->fullscreen) || (bd->need_fullscreen))
+ {
+ if (bd->layer != IL_FULLSCREEN_LAYER)
+ e_border_layer_set(bd, IL_FULLSCREEN_LAYER);
+ }
+ else
+ {
+ if (bd->layer != IL_APP_LAYER)
+ e_border_layer_set(bd, IL_APP_LAYER);
+ }
}
}
}
@@ -302,76 +315,67 @@ _zone_layout_dual(E_Border *bd)
static void
_zone_layout_dual_top(E_Border *bd)
{
- int kx, ky, kw, kh;
- int ss = 0, ps = 0;
int conform;
+ int kx, ky, kw, kh;
+ int ps = 0, ss = 0;
+ int by, bh;
+ E_Border *b;
conform = e_illume_border_is_conformant(bd);
e_illume_kbd_safe_app_region_get(bd->zone, &kx, &ky, &kw, &kh);
- if (!conform)
- {
- if (!((bd->need_fullscreen) || (bd->fullscreen)))
- {
- if (kh >= bd->zone->h) ps = panelsize;
- ss = shelfsize;
- }
- }
- if (e_illume_border_valid_count_get(bd->zone) < 2)
+ if (!((bd->need_fullscreen) || (bd->fullscreen)))
{
- if ((bd->w != kw) || (bd->h != (kh - ss - ps)))
- _zone_layout_border_resize(bd, kw, (kh - ss - ps));
- if ((bd->x != kx) || (bd->y != (ky + ss)))
- _zone_layout_border_move(bd, kx, (ky + ss));
+ if (kh >= bd->zone->h) ps = panelsize;
+ ss = shelfsize;
}
- else
- {
- E_Border *b;
- int by, bh;
- /* more than one valid border */
- by = (ky + ss);
- bh = ((kh - ss - ps) / 2);
+ by = (ky + ss);
+ bh = ((kh - ss - ps) / 2);
- /* grab the border at this location */
- b = e_illume_border_at_xy_get(bd->zone, kx, by);
- if ((b) && (bd != b))
+ b = e_illume_border_at_xy_get(bd->zone, kx, by);
+ if ((b) && (bd != b))
+ {
+ if (e_illume_border_is_home(b))
{
- if (e_illume_border_is_home(b))
+ if (conform)
{
- if (e_illume_border_is_home(bd))
- by = (b->y + b->h);
+ by = ky;
+ bh += ss;
}
- else if (!e_illume_border_is_conformant(b))
+ else if (e_illume_border_is_home(bd))
by = (b->y + b->h);
- else
- {
- if (conform)
- {
- bh = ((bd->zone->h - ss) / 2);
- by = by + bh;
- }
- else
- {
- by = (b->y + b->h);
- bh = (kh - by - ps);
- }
- }
}
- else if (b)
- by = bd->y;
+ else if (e_illume_border_is_conformant(b))
+ {
+ by = (b->y + b->h);
+ if (conform) bh += ps;
+ }
else
{
- b = e_illume_border_valid_border_get(bd->zone);
- by = ky + ss;
- bh = (ky - b->h);
+ by = (b->y + b->h);
+ if (conform) bh += ps;
}
+ }
+ else if (b)
+ {
+ if (bd->client.vkbd.state > ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
+ {
+ by = (ky + ss);
+ bh = ((kh - ss - ps) / 2);
+ }
+ }
- if ((bd->w != kw) || (bd->h != bh))
- _zone_layout_border_resize(bd, kw, bh);
- if ((bd->x != kx) || (bd->y != by))
- _zone_layout_border_move(bd, kx, by);
+ if ((bd->need_fullscreen) || (bd->fullscreen))
+ {
+ by = ky;
+ bh = kh;
}
+
+ if ((bd->w != kw) || (bd->h != bh))
+ _zone_layout_border_resize(bd, kw, bh);
+ if ((bd->x != kx) || (bd->y != by))
+ _zone_layout_border_move(bd, kx, by);
}
static void
@@ -479,87 +483,77 @@ _zone_layout_dual_top_custom(E_Border *bd)
static void
_zone_layout_dual_left(E_Border *bd)
{
- int kx, ky, kw, kh, ss = 0, ps = 0;
int conform;
+ int kx, ky, kw, kh;
+ int ps = 0, ss = 0;
+ int by, bh, bx, bw;
+ E_Border *b;
- /* fetch if this border is conformant */
conform = e_illume_border_is_conformant(bd);
-
- /* grab the 'safe' region. Safe region is space not occupied by keyboard */
e_illume_kbd_safe_app_region_get(bd->zone, &kx, &ky, &kw, &kh);
- if (!conform)
- {
- /* if the border is not conformant and doesn't need fullscreen, then
- * we account for shelf & panel sizes */
- if (!((bd->need_fullscreen) || (bd->fullscreen)))
- {
- if (kh >= bd->zone->h) ps = panelsize;
- ss = shelfsize;
- }
- }
- /* if there are no other borders, than give this one all available space */
- if (e_illume_border_valid_count_get(bd->zone) < 2)
+ if (!((bd->need_fullscreen) || (bd->fullscreen)))
{
- if ((bd->w != kw) || (bd->h != (kh - ss - ps)))
- _zone_layout_border_resize(bd, kw, (kh - ss - ps));
- if ((bd->x != kx) || (bd->y != (ky + ss)))
- _zone_layout_border_move(bd, kx, (ky + ss));
+ if (kh >= bd->zone->h) ps = panelsize;
+ ss = shelfsize;
}
- else
- {
- E_Border *b;
- int bx, by, bw, bh;
- /* more than one valid border */
- bx = kx;
- by = (ky + ss);
- bw = (kw / 2);
- bh = (kh - ss - ps);
+ bx = kx;
+ by = (ky + ss);
+ bw = (kw / 2);
+ bh = (kh - ss - ps);
- /* grab the border at this location */
- b = e_illume_border_at_xy_get(bd->zone, kx, by);
- if ((b) && (bd != b))
+ b = e_illume_border_at_xy_get(bd->zone, kx, by);
+ if ((b) && (bd != b))
+ {
+ if (e_illume_border_is_home(b))
{
- if (e_illume_border_is_home(b))
+ if (conform)
{
- if (e_illume_border_is_home(bd))
- bx = (b->x + b->w);
+ by = ky;
+ bh += ps + ss;
}
- else if (!e_illume_border_is_conformant(b))
+ else if (e_illume_border_is_home(bd))
+ bx = (b->x + b->w);
+ }
+ else if (e_illume_border_is_conformant(b))
+ {
+ bx = (b->x + b->w);
+ if (conform)
{
- /* border in this location is not conformant */
- bx = (b->x + b->w);
+ by = ky;
+ bh += ps + ss;
}
- else
+ }
+ else
+ {
+ bx = (b->x + b->w);
+ if (conform)
{
- /* border there is conformant */
- if (conform)
- {
- /* if current border is conformant, divide zone in half */
- bw = (bd->zone->w / 2);
- bx = bx + bw;
- }
- else
- {
- /* current border is not conformant */
- bx = (b->x + b->w);
- bw = (kw - bx);
- }
+ by = ky;
+ bh += ps + ss;
}
}
- else if (b)
- bx = bd->x;
- else
+ }
+ else if (b)
+ {
+ if (bd->client.vkbd.state > ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
{
- /* no border at this location */
- b = e_illume_border_valid_border_get(bd->zone);
- bx = kx;
- bw = (kw - b->w);
+ by = (ky + ss);
+ bh = ((kh - ss - ps) / 2);
}
- if ((bd->w != bw) || (bd->h != bh))
- _zone_layout_border_resize(bd, bw, bh);
- if ((bd->x != bx) || (bd->y != by))
- _zone_layout_border_move(bd, bx, by);
}
+
+ if ((bd->need_fullscreen) || (bd->fullscreen))
+ {
+ bx = kx;
+ by = ky;
+ bw = kw;
+ bh = kh;
+ }
+
+ if ((bd->w != bw) || (bd->h != bh))
+ _zone_layout_border_resize(bd, bw, bh);
+ if ((bd->x != bx) || (bd->y != by))
+ _zone_layout_border_move(bd, bx, by);
}