]> git.sur5r.net Git - i3/i3/blobdiff - src/commands.c
Merge pull request #1608 from mh21/renaming-empty-ws-startup
[i3/i3] / src / commands.c
index 589c49ad300af1b91c695606541159ce5debed57..2c709aef7a77106cb4505b164218c8f93e28c637 100644 (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);
     }