Bugfix: Correctly check boundaries and reassign floating windows when moving (Thanks xpt)

Fixes: #592
This commit is contained in:
Michael Stapelberg
2011-12-18 17:24:27 +00:00
parent 59a694edea
commit 4fba2d5f91
4 changed files with 43 additions and 22 deletions

View File

@ -780,20 +780,21 @@ move:
printf("moving in direction %d\n", direction);
if (con_is_floating(focused)) {
printf("floating move with %d pixels\n", px);
Rect newrect = focused->parent->rect;
if (direction == TOK_LEFT) {
focused->parent->rect.x -= px;
newrect.x -= px;
} else if (direction == TOK_RIGHT) {
focused->parent->rect.x += px;
newrect.x += px;
} else if (direction == TOK_UP) {
focused->parent->rect.y -= px;
newrect.y -= px;
} else if (direction == TOK_DOWN) {
focused->parent->rect.y += px;
newrect.y += px;
}
floating_reposition(focused->parent, newrect);
} else {
tree_move(direction);
tree_render();
}
tree_render();
}
| TOK_MOVE TOK_WORKSPACE STR
{