From 67217822b8f11fb88df4e8752f08274ef741e122 Mon Sep 17 00:00:00 2001 From: Albert Safin Date: Tue, 1 Oct 2019 07:24:21 +0000 Subject: [PATCH] do not try to center floating window on itself Some apps including XTerm start with a WM_CLIENT_LEADER property containing their own window ID. Before this commit, i3 tried to center such windows onto itself and did it wrong since `leader->rect == {0,0,0,0}` at this moment. The first affected commit is 128122e7663a5a1f38bd8f921ecaef55ff2a4b13, however, before it such windows already was misplaced, but got sanitized afterward [1]. [1]: https://github.com/i3/i3/blob/8a3ef3a81bd4946777c7e3585384283bf12d89be/src/floating.c#L329-L335 Fixes #3606 --- src/floating.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/floating.c b/src/floating.c index 9a721301..70e7bc17 100644 --- a/src/floating.c +++ b/src/floating.c @@ -371,6 +371,7 @@ void floating_enable(Con *con, bool automatic) { if (nc->rect.x == 0 && nc->rect.y == 0) { Con *leader; if (con->window && con->window->leader != XCB_NONE && + con->window->id != con->window->leader && (leader = con_by_window_id(con->window->leader)) != NULL) { DLOG("Centering above leader\n"); floating_center(nc, leader->rect);