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);
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)))
{
}
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);
}
}
|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
}
else if(cme->message_type == netatom[NetActiveWindow]) {
+ return;
if(!ISVISIBLE(c)) {
c->mon->seltags ^= 1;
c->mon->tagset[c->mon->seltags] = c->tags;
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) {