Bugfix: Position floating windows exactly where their geometry specified (Thanks B-Con)

Fixes #619
This commit is contained in:
Michael Stapelberg
2012-01-21 14:20:55 +00:00
parent 9798e5cae6
commit cb4c9b9d27
2 changed files with 11 additions and 5 deletions

View File

@ -176,6 +176,14 @@ void floating_enable(Con *con, bool automatic) {
if (automatic)
con->border_style = config.default_floating_border;
/* 5: Subtract the deco_height in order to make the floating window appear
* at precisely the position it specified in its original geometry (which
* is what applications might remember). */
deco_height = (con->border_style == BS_NORMAL ? config.font.height + 5 : 0);
nc->rect.y -= deco_height;
DLOG("Corrected y = %d (deco_height = %d)\n", nc->rect.y, deco_height);
TAILQ_INSERT_TAIL(&(nc->nodes_head), con, nodes);
TAILQ_INSERT_TAIL(&(nc->focus_head), con, focused);