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;
const char *title;
unsigned int tags;
Bool isfloating;
+ Bool screen_hog;
int monitor;
} Rule;
static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact);
static void arrange(Monitor *m);
static void arrangemon(Monitor *m);
+static void attach_as_master(Client *c);
static void attach(Client *c);
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
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;
for(i = 0; i < LENGTH(rules); i++) {
r = &rules[i];
- if((!r->title || strstr(c->name, r->title))
+ if((!r->title || c->name == strstr(c->name, r->title))
&& (!r->class || strstr(class, r->class))
&& (!r->instance || strstr(instance, r->instance)))
{
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;
}
void
+attach_as_master(Client *c) {
+ c->next = c->mon->clients;
+ c->mon->clients = c;
+}
+void
attach(Client *c) {
if (c->mon->sel) {
c->next = c->mon->sel->next;
c->mon->sel->next = c;
} else {
- c->next = c->mon->clients;
- c->mon->clients = c;
+ attach_as_master(c);
}
}
void
pop(Client *c) {
detach(c);
- attach(c);
+ attach_as_master(c);
focus(c);
arrange(c->mon);
}
void
spawn(const Arg *arg) {
+ int tag = 0, i;
+ if(arg->v == termcmd) {
+ for(i = 0; i < 32; ++i) {
+ if(selmon->tagset[selmon->seltags] & (1 << i)) {
+ tag = i;
+ break;
+ }
+ }
+ _SWM_WS[8] = swm_tags[tag][0];
+ _SWM_WS[9] = swm_tags[tag][1];
+ }
if(arg->v == dmenucmd)
dmenumon[0] = '0' + selmon->num;
if(fork() == 0) {
if(n > m->nmaster)
mw = m->nmaster ? m->ww * m->mfact : 0;
- else
- mw = m->ww;
+ 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);