From: Deiz Date: Thu, 26 Mar 2015 02:40:59 +0000 (-0400) Subject: Make center coordinates relative to current workspace X-Git-Tag: 4.11~161^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=24f0ea2f24661932e9e5055beeda7650621d5db0;p=i3%2Fi3 Make center coordinates relative to current workspace Fixes #1211 --- diff --git a/src/commands.c b/src/commands.c index 9b51b3ec..2121fc66 100644 --- a/src/commands.c +++ b/src/commands.c @@ -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); }