From 9fa9a6305223f0548ae5664b9be16e39ba59eebb Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Fri, 23 May 2025 11:36:36 +0000 Subject: Personal configuration --- config.mk | 4 ++-- dwl.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config.mk b/config.mk index 1e0b810..fb99950 100644 --- a/config.mk +++ b/config.mk @@ -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 diff --git a/dwl.c b/dwl.c index a2711f6..50bbbc4 100644 --- a/dwl.c +++ b/dwl.c @@ -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); -- cgit v1.2.3