Merge pull request #1589 from Deiz/fix-center

Make center coordinates relative to current workspace
This commit is contained in:
Michael Stapelberg
2015-03-30 08:47:04 +02:00
2 changed files with 65 additions and 2 deletions

View File

@ -1776,8 +1776,8 @@ void cmd_move_window_to_center(I3_CMD, char *method) {
Rect newrect = focused->parent->rect;
DLOG("moving to center\n");
newrect.x = wsrect->width / 2 - newrect.width / 2;
newrect.y = wsrect->height / 2 - newrect.height / 2;
newrect.x = wsrect->x + wsrect->width / 2 - newrect.width / 2;
newrect.y = wsrect->y + wsrect->height / 2 - newrect.height / 2;
floating_reposition(focused->parent, newrect);
}