]> git.sur5r.net Git - i3/i3/commitdiff
Make center coordinates relative to current workspace
authorDeiz <silverwraithii@gmail.com>
Thu, 26 Mar 2015 02:40:59 +0000 (22:40 -0400)
committerDeiz <silverwraithii@gmail.com>
Thu, 26 Mar 2015 02:40:59 +0000 (22:40 -0400)
Fixes #1211

src/commands.c

index 9b51b3ecc7cba9d7561819d77a42519fd757d142..2121fc667bd02a8319e03f9eba8a60048fc85e8a 100644 (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);
     }