X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcommands.c;h=2c709aef7a77106cb4505b164218c8f93e28c637;hb=2759a308a2a026759e063599f8ed8c99c4500502;hp=589c49ad300af1b91c695606541159ce5debed57;hpb=f76e6c2bb1ea4a29429f009758b85185e2989464;p=i3%2Fi3 diff --git a/src/commands.c b/src/commands.c index 589c49ad..2c709aef 100644 --- a/src/commands.c +++ b/src/commands.c @@ -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); }