Fix various metrics problems with titlebar

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-03-15 17:42:38 +01:00
parent dd71f55469
commit 99d72010c5
2 changed files with 19 additions and 7 deletions

View File

@ -374,15 +374,27 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
switch(c->titlebar.position)
{
default:
case Top:
c->titlebar.sw = simplewindow_new(globalconf.display,
phys_screen, 0, 0,
phys_screen,
c->geometry.x,
c->geometry.y - titlebar_height,
c->geometry.width + 2 * c->border,
titlebar_height,
0);
break;
case Bottom:
c->titlebar.sw = simplewindow_new(globalconf.display,
phys_screen,
c->geometry.x,
c->geometry.y + c->geometry.height + 2 * c->border,
c->geometry.width + 2 * c->border,
titlebar_height,
0);
break;
case Auto:
case Off:
break;
default:
c->titlebar.position = Off;
break;
}

View File

@ -70,14 +70,14 @@ titlebar_update_geometry_floating(Client *c)
simplewindow_move_resize(c->titlebar.sw,
c->geometry.x,
c->geometry.y - c->titlebar.sw->geometry.height,
c->geometry.width,
c->geometry.width + 2 * c->border,
c->titlebar.sw->geometry.height);
break;
case Bottom:
simplewindow_move_resize(c->titlebar.sw,
c->geometry.x,
c->geometry.y + c->geometry.height + 2 * c->border,
c->geometry.width,
c->geometry.width + 2 * c->border,
c->titlebar.sw->geometry.height);
break;
}
@ -96,7 +96,7 @@ titlebar_update_geometry(Client *c, area_t geometry)
simplewindow_move_resize(c->titlebar.sw,
geometry.x,
geometry.y,
geometry.width,
geometry.width + 2 * c->border,
c->titlebar.sw->geometry.height);
geometry.y += c->titlebar.sw->geometry.height;
geometry.height -= c->titlebar.sw->geometry.height;
@ -106,7 +106,7 @@ titlebar_update_geometry(Client *c, area_t geometry)
simplewindow_move_resize(c->titlebar.sw,
geometry.x,
geometry.y + geometry.height + 2 * c->border,
geometry.width,
geometry.width + 2 * c->border,
c->titlebar.sw->geometry.height);
break;
}