Make center coordinates relative to current workspace

Fixes #1211
This commit is contained in:
Deiz 2015-03-25 22:40:59 -04:00
parent 037cb317cb
commit 24f0ea2f24

View File

@ -1761,8 +1761,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);
}