mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-12-19 03:13:19 +00:00
Center floating windows
Credits to Benjamin Chausse for fixing this with multiple monitors.
This commit is contained in:
parent
a0a4d8266f
commit
24f702fbc1
4
dwl.c
4
dwl.c
@ -519,6 +519,8 @@ applyrules(Client *c)
|
|||||||
mon = m;
|
mon = m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
c->geom.x = (mon->w.width - c->geom.width) / 2 + mon->m.x;
|
||||||
|
c->geom.y = (mon->w.height - c->geom.height) / 2 + mon->m.y;
|
||||||
wlr_scene_node_reparent(c->scene, layers[c->isfloating ? LyrFloat : LyrTile]);
|
wlr_scene_node_reparent(c->scene, layers[c->isfloating ? LyrFloat : LyrTile]);
|
||||||
setmon(c, mon, newtags);
|
setmon(c, mon, newtags);
|
||||||
}
|
}
|
||||||
@ -1667,6 +1669,8 @@ mapnotify(struct wl_listener *listener, void *data)
|
|||||||
c->isfloating = 1;
|
c->isfloating = 1;
|
||||||
wlr_scene_node_reparent(c->scene, layers[LyrFloat]);
|
wlr_scene_node_reparent(c->scene, layers[LyrFloat]);
|
||||||
setmon(c, p->mon, p->tags);
|
setmon(c, p->mon, p->tags);
|
||||||
|
c->geom.x = (c->mon->w.width - c->geom.width) / 2 + c->mon->m.x;
|
||||||
|
c->geom.y = (c->mon->w.height - c->geom.height) / 2 + c->mon->m.y;
|
||||||
} else {
|
} else {
|
||||||
applyrules(c);
|
applyrules(c);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user