From 78b170ad113be58d6b22452a6e4fd080c5429be2 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Wed, 19 Nov 2014 11:12:40 -0500 Subject: [PATCH] add screen_hog rule/flag --- dwm.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dwm.c b/dwm.c index 27c4f92..b902b3b 100644 --- a/dwm.c +++ b/dwm.c @@ -91,7 +91,7 @@ struct Client { int basew, baseh, incw, inch, maxw, maxh, minw, minh; int bw, oldbw; unsigned int tags; - Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; + Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, screen_hog; Client *next; Client *snext; Monitor *mon; @@ -137,6 +137,7 @@ typedef struct { const char *title; unsigned int tags; Bool isfloating; + Bool screen_hog; int monitor; } Rule; @@ -299,7 +300,7 @@ applyrules(Client *c) { XClassHint ch = { NULL, NULL }; /* rule matching */ - c->isfloating = c->tags = 0; + c->isfloating = c->tags = c->screen_hog = 0; XGetClassHint(dpy, c->win, &ch); class = ch.res_class ? ch.res_class : broken; instance = ch.res_name ? ch.res_name : broken; @@ -312,6 +313,7 @@ applyrules(Client *c) { { c->isfloating = r->isfloating; c->tags |= r->tags; + c->screen_hog = r->screen_hog; for(m = mons; m && m->num != r->monitor; m = m->next); if(m) c->mon = m; @@ -1686,8 +1688,13 @@ tile(Monitor *m) { if(n > m->nmaster) mw = m->nmaster ? m->ww * m->mfact : 0; - else - mw = m->ww * m->mfact; + else { + c = nexttiled(m->clients); + if (c && !c->screen_hog) + mw = m->ww * m->mfact; + else + mw = m->ww; + } for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) if(i < m->nmaster) { h = (m->wh - my) / (MIN(n, m->nmaster) - i); -- 1.7.10.4