From 99d72010c52069c07a0b189306dff1deb359ace7 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 15 Mar 2008 17:42:38 +0100 Subject: [PATCH] Fix various metrics problems with titlebar Signed-off-by: Julien Danjou --- client.c | 18 +++++++++++++++--- titlebar.c | 8 ++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/client.c b/client.c index 39c52fc59..705c79805 100644 --- a/client.c +++ b/client.c @@ -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; } diff --git a/titlebar.c b/titlebar.c index ea657c1b9..4063cd9bc 100644 --- a/titlebar.c +++ b/titlebar.c @@ -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; }