Scratchpads improvement (multi-monitor support)
parent
fce55dadcb
commit
f4f5ecab75
@ -1,25 +1,34 @@
|
|||||||
void
|
void
|
||||||
togglescratch(const Arg *arg)
|
togglescratch(const Arg *arg)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c = NULL;
|
||||||
unsigned int found = 0;
|
Monitor *mon;
|
||||||
unsigned int scratchtag = SPTAG(arg->ui);
|
unsigned int found = 0;
|
||||||
Arg sparg = {.v = scratchpads[arg->ui].cmd};
|
unsigned int scratchtag = SPTAG(arg->ui);
|
||||||
|
Arg sparg = {.v = scratchpads[arg->ui].cmd};
|
||||||
|
|
||||||
for (c = selmon->clients; c && !(found = c->tags & scratchtag); c = c->next);
|
for (mon = mons; mon && !found; mon = mon->next)
|
||||||
if (found) {
|
for (c = mon->clients; c && !(found = c->tags & scratchtag); c = c->next);
|
||||||
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchtag;
|
|
||||||
if (newtagset) {
|
if (found) {
|
||||||
selmon->tagset[selmon->seltags] = newtagset;
|
if (c->mon != selmon) {
|
||||||
focus(NULL);
|
if (c->mon->tagset[c->mon->seltags] & SPTAGMASK)
|
||||||
arrange(selmon);
|
c->mon->tagset[c->mon->seltags] ^= scratchtag;
|
||||||
}
|
sendmon(c, selmon);
|
||||||
if (ISVISIBLE(c)) {
|
}
|
||||||
focus(c);
|
|
||||||
restack(selmon);
|
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchtag;
|
||||||
}
|
if (newtagset) {
|
||||||
} else {
|
selmon->tagset[selmon->seltags] = newtagset;
|
||||||
selmon->tagset[selmon->seltags] |= scratchtag;
|
focus(NULL);
|
||||||
spawn(&sparg);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
if (ISVISIBLE(c)) {
|
||||||
|
focus(c);
|
||||||
|
restack(selmon);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
selmon->tagset[selmon->seltags] |= scratchtag;
|
||||||
|
spawn(&sparg);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue