summaryrefslogtreecommitdiffhomepage
path: root/patch/tagallmon.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-09-05 11:38:09 +0200
committerbakkeby <[email protected]>2020-09-05 11:38:09 +0200
commit5f5dc7ab9ca014eb9eb9ded31ce0455c9771c833 (patch)
treea05df8aacb9a7051119c9d13b581b8fd673c2f03 /patch/tagallmon.c
parentdcf7b049bade7767f9a7c726ae445c86cedcd291 (diff)
downloaddwm-flexipatch-5f5dc7ab9ca014eb9eb9ded31ce0455c9771c833.tar.gz
dwm-flexipatch-5f5dc7ab9ca014eb9eb9ded31ce0455c9771c833.zip
Assortment of fullscreen improvements (togglefullscreen / fakefullscreenclient / tagallmon / tagswapmon)
Diffstat (limited to 'patch/tagallmon.c')
-rw-r--r--patch/tagallmon.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/patch/tagallmon.c b/patch/tagallmon.c
index 51af142..f863b6d 100644
--- a/patch/tagallmon.c
+++ b/patch/tagallmon.c
@@ -2,27 +2,44 @@ void
tagallmon(const Arg *arg)
{
Monitor *m;
- Client *c;
- Client *next;
+ Client *c, *last, *slast, *next;
if (!mons->next)
return;
m = dirtomon(arg->i);
+ for (last = m->clients; last && last->next; last = last->next);
+ for (slast = m->stack; slast && slast->snext; slast = slast->snext);
+
for (c = selmon->clients; c; c = next) {
next = c->next;
if (!ISVISIBLE(c))
continue;
- unfocus(c, 1);
+ unfocus(c, 1, NULL);
detach(c);
detachstack(c);
c->mon = m;
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
- attach(c);
- attachstack(c);
+ c->next = NULL;
+ c->snext = NULL;
+ if (last)
+ last = last->next = c;
+ else
+ m->clients = last = c;
+ if (slast)
+ slast = slast->snext = c;
+ else
+ m->stack = slast = c;
if (c->isfullscreen) {
- setfullscreen(c, 0);
- setfullscreen(c, 1);
+ #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH
+ if (c->fakefullscreen != 1) {
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ XRaiseWindow(dpy, c->win);
+ }
+ #elif !FAKEFULLSCREEN_PATCH
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ XRaiseWindow(dpy, c->win);
+ #endif // FAKEFULLSCREEN_CLIENT_PATCH
}
}