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 is128122e766
, however, before it such windows already was misplaced, but got sanitized afterward [1]. [1]:8a3ef3a81b/src/floating.c (L329-L335)
Fixes #3606
This commit is contained in:
parent
7db0d179a3
commit
67217822b8
|
@ -371,6 +371,7 @@ void floating_enable(Con *con, bool automatic) {
|
||||||
if (nc->rect.x == 0 && nc->rect.y == 0) {
|
if (nc->rect.x == 0 && nc->rect.y == 0) {
|
||||||
Con *leader;
|
Con *leader;
|
||||||
if (con->window && con->window->leader != XCB_NONE &&
|
if (con->window && con->window->leader != XCB_NONE &&
|
||||||
|
con->window->id != con->window->leader &&
|
||||||
(leader = con_by_window_id(con->window->leader)) != NULL) {
|
(leader = con_by_window_id(con->window->leader)) != NULL) {
|
||||||
DLOG("Centering above leader\n");
|
DLOG("Centering above leader\n");
|
||||||
floating_center(nc, leader->rect);
|
floating_center(nc, leader->rect);
|
||||||
|
|
Loading…
Reference in New Issue