Add alwayscenterp patch
This commit is contained in:
14
dwl.c
14
dwl.c
@@ -613,6 +613,14 @@ applyrules(Client *c)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if ALWAYSCENTER_PATCH
|
||||
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;
|
||||
}
|
||||
#endif // ALWAYSCENTER_PATCH
|
||||
|
||||
setmon(c, mon, newtags);
|
||||
}
|
||||
|
||||
@@ -2383,6 +2391,12 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||
* try to apply rules for them */
|
||||
if ((p = client_get_parent(c))) {
|
||||
c->isfloating = 1;
|
||||
#if ALWAYSCENTER_PATCH
|
||||
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;
|
||||
}
|
||||
#endif // ALWAYSCENTER_PATCH
|
||||
setmon(c, p->mon, p->tags);
|
||||
} else {
|
||||
applyrules(c);
|
||||
|
Reference in New Issue
Block a user