summaryrefslogtreecommitdiff
path: root/patch/tagallmon.c
diff options
context:
space:
mode:
authorBear <bear@bengtsson.win>2021-12-27 09:29:58 +0000
committerBear <bear@bengtsson.win>2021-12-27 09:29:58 +0000
commit69262b01ced79c2d776fab9b889926d1816a1e7a (patch)
treef304cd6fa8734e83a7772d07dc9b484781565155 /patch/tagallmon.c
Added DWM
Diffstat (limited to 'patch/tagallmon.c')
-rw-r--r--patch/tagallmon.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/patch/tagallmon.c b/patch/tagallmon.c
new file mode 100644
index 0000000..d6b879a
--- /dev/null
+++ b/patch/tagallmon.c
@@ -0,0 +1,49 @@
+void
+tagallmon(const Arg *arg)
+{
+ Monitor *m;
+ 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, NULL);
+ detach(c);
+ detachstack(c);
+ c->mon = m;
+ c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
+ 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) {
+ #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
+ }
+ }
+
+ focus(NULL);
+ arrange(NULL);
+}
+