summaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/dwl.c b/dwl.c
index 0e07ac4..74840e4 100644
--- a/dwl.c
+++ b/dwl.c
@@ -143,7 +143,7 @@ struct Client {
#endif
unsigned int bw;
uint32_t tags;
- int isfloating, isurgent, isfullscreen, issticky, isterm, noswallow;
+ int iscentered, isfloating, isurgent, isfullscreen, issticky, isterm, noswallow;
char scratchkey;
uint32_t resize; /* configure serial of a pending resize */
pid_t pid;
@@ -236,6 +236,7 @@ typedef struct {
const char *id;
const char *title;
uint32_t tags;
+ int iscentered;
int isfloating;
int isterm;
int noswallow;
@@ -490,6 +491,7 @@ applyrules(Client *c)
for (r = rules; r < END(rules); r++) {
if ((!r->title || strstr(title, r->title))
&& (!r->id || strstr(appid, r->id))) {
+ c->iscentered = r->iscentered;
c->isfloating = r->isfloating;
c->scratchkey = r->scratchkey;
c->isterm = r->isterm;
@@ -517,6 +519,12 @@ applyrules(Client *c)
newtags = p->tags;
}
}
+
+ if (c->iscentered) {
+ 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);
}