Fix up layout code wrt fullscreen apps, conformant apps, and vkbd.

SVN revision: 45598
This commit is contained in:
Christopher Michael 2010-01-26 20:13:34 +00:00
parent f0588f2b2d
commit eeb3a3318d
1 changed files with 114 additions and 120 deletions

View File

@ -206,8 +206,21 @@ _layout_zone_layout(E_Zone *zone)
{ {
if (cfg_zone->mode.dual) _zone_layout_dual(bd); if (cfg_zone->mode.dual) _zone_layout_dual(bd);
else _zone_layout_single(bd); else _zone_layout_single(bd);
if (bd->layer != IL_APP_LAYER) if (e_illume_border_is_conformant(bd))
e_border_layer_set(bd, IL_APP_LAYER); {
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 static void
_zone_layout_dual_top(E_Border *bd) _zone_layout_dual_top(E_Border *bd)
{ {
int kx, ky, kw, kh;
int ss = 0, ps = 0;
int conform; 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); conform = e_illume_border_is_conformant(bd);
e_illume_kbd_safe_app_region_get(bd->zone, &kx, &ky, &kw, &kh); e_illume_kbd_safe_app_region_get(bd->zone, &kx, &ky, &kw, &kh);
if (!conform)
if (!((bd->need_fullscreen) || (bd->fullscreen)))
{ {
if (!((bd->need_fullscreen) || (bd->fullscreen))) if (kh >= bd->zone->h) ps = panelsize;
{ ss = shelfsize;
if (kh >= bd->zone->h) ps = panelsize;
ss = shelfsize;
}
} }
if (e_illume_border_valid_count_get(bd->zone) < 2) by = (ky + ss);
{ bh = ((kh - ss - ps) / 2);
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));
}
else
{
E_Border *b;
int by, bh;
/* more than one valid border */ b = e_illume_border_at_xy_get(bd->zone, kx, by);
by = (ky + ss); if ((b) && (bd != b))
bh = ((kh - ss - ps) / 2); {
if (e_illume_border_is_home(b))
/* grab the border at this location */
b = e_illume_border_at_xy_get(bd->zone, kx, by);
if ((b) && (bd != b))
{ {
if (e_illume_border_is_home(b)) if (conform)
{ {
if (e_illume_border_is_home(bd)) by = ky;
by = (b->y + b->h); bh += ss;
} }
else if (!e_illume_border_is_conformant(b)) else if (e_illume_border_is_home(bd))
by = (b->y + b->h); 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) else if (e_illume_border_is_conformant(b))
by = bd->y; {
by = (b->y + b->h);
if (conform) bh += ps;
}
else else
{ {
b = e_illume_border_valid_border_get(bd->zone); by = (b->y + b->h);
by = ky + ss; if (conform) bh += ps;
bh = (ky - b->h);
} }
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);
} }
else if (b)
{
if (bd->client.vkbd.state > ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
{
by = (ky + ss);
bh = ((kh - ss - ps) / 2);
}
}
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 static void
@ -479,87 +483,77 @@ _zone_layout_dual_top_custom(E_Border *bd)
static void static void
_zone_layout_dual_left(E_Border *bd) _zone_layout_dual_left(E_Border *bd)
{ {
int kx, ky, kw, kh, ss = 0, ps = 0;
int conform; 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); 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); e_illume_kbd_safe_app_region_get(bd->zone, &kx, &ky, &kw, &kh);
if (!conform)
if (!((bd->need_fullscreen) || (bd->fullscreen)))
{ {
/* if the border is not conformant and doesn't need fullscreen, then if (kh >= bd->zone->h) ps = panelsize;
* we account for shelf & panel sizes */ ss = shelfsize;
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 */ bx = kx;
if (e_illume_border_valid_count_get(bd->zone) < 2) by = (ky + ss);
{ bw = (kw / 2);
if ((bd->w != kw) || (bd->h != (kh - ss - ps))) bh = (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));
}
else
{
E_Border *b;
int bx, by, bw, bh;
/* more than one valid border */ b = e_illume_border_at_xy_get(bd->zone, kx, by);
bx = kx; if ((b) && (bd != b))
by = (ky + ss); {
bw = (kw / 2); if (e_illume_border_is_home(b))
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))
{ {
if (e_illume_border_is_home(b)) if (conform)
{ {
if (e_illume_border_is_home(bd)) by = ky;
bx = (b->x + b->w); 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 */ by = ky;
bx = (b->x + b->w); bh += ps + ss;
}
else
{
/* 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);
}
} }
} }
else if (b)
bx = bd->x;
else else
{ {
/* no border at this location */ bx = (b->x + b->w);
b = e_illume_border_valid_border_get(bd->zone); if (conform)
bx = kx; {
bw = (kw - b->w); by = ky;
bh += ps + ss;
}
} }
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);
} }
else if (b)
{
if (bd->client.vkbd.state > ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)
{
by = (ky + ss);
bh = ((kh - ss - ps) / 2);
}
}
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);
} }