From b6f86ebb6302765dc12bf6a4b1ca601650a90e4a Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 14 Mar 2008 17:52:42 +0100 Subject: [PATCH] Smart placement support handling titlebar --- client.c | 10 ++++++++++ placement.c | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/client.c b/client.c index 88be0753..81e752af 100644 --- a/client.c +++ b/client.c @@ -436,8 +436,18 @@ client_manage(Window w, XWindowAttributes *wa, int screen) client_setfloating(c, rettrans || c->isfixed); if(!(flags & (USPosition | PPosition))) + { c->f_geometry = globalconf.screens[c->screen].floating_placement(c->f_geometry, c->border, c->screen); + switch(c->titlebar.position) + { + case Top: + c->f_geometry.y += c->titlebar.sw->geometry.height; + break; + default: + break; + } + } XSelectInput(globalconf.display, w, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); diff --git a/placement.c b/placement.c index 7927fb4f..bffc1182 100644 --- a/placement.c +++ b/placement.c @@ -82,6 +82,15 @@ placement_smart(area_t geometry, int border, int screen) newgeometry = c->f_geometry; newgeometry.width += 2 * c->border; newgeometry.height += 2 * c->border; + switch(c->titlebar.position) + { + case Top: + newgeometry.height += c->titlebar.sw->geometry.height; + newgeometry.y -= c->titlebar.sw->geometry.height; + break; + default: + break; + } area_list_remove(&arealist, &newgeometry); }