diff options
author | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:36:36 +0000 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:36:36 +0000 |
commit | 9fa9a6305223f0548ae5664b9be16e39ba59eebb (patch) | |
tree | 1cb12dc35018f3a3f801269e06208db051060776 | |
parent | 74e45c4014ae7048ecbb76eb6f54034b8b479480 (diff) | |
download | dwl-master.tar.gz dwl-master.tar.bz2 dwl-master.zip |
-rw-r--r-- | config.mk | 4 | ||||
-rw-r--r-- | dwl.c | 8 |
2 files changed, 10 insertions, 2 deletions
@@ -11,7 +11,7 @@ DATADIR = $(PREFIX)/share XWAYLAND = XLIBS = # Uncomment to build XWayland support -#XWAYLAND = -DXWAYLAND -#XLIBS = xcb xcb-icccm +XWAYLAND = -DXWAYLAND +XLIBS = xcb xcb-icccm CC = gcc @@ -478,6 +478,10 @@ applyrules(Client *c) } } } + if (mon) { + 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; + } setmon(c, mon, newtags); } @@ -1734,6 +1738,10 @@ mapnotify(struct wl_listener *listener, void *data) * try to apply rules for them */ if ((p = client_get_parent(c))) { c->isfloating = 1; + if (p->mon) { + c->geom.x = (p->mon->w.width - c->geom.width) / 2 + p->mon->m.x; + c->geom.y = (p->mon->w.height - c->geom.height) / 2 + p->mon->m.y; + } setmon(c, p->mon, p->tags); } else { applyrules(c); |