summaryrefslogtreecommitdiffhomepage
path: root/patch/transferall.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-02-02 11:55:19 +0100
committerbakkeby <[email protected]>2020-02-02 11:55:19 +0100
commit6de03c1735b272a8081ffc8a25e078ec7e37f2c1 (patch)
tree7951a7c3bdc54418469c9986914c4dc677705818 /patch/transferall.c
parent4ddfdab30ef77637b1a112dc181606c1260f84af (diff)
downloaddwm-flexipatch-6de03c1735b272a8081ffc8a25e078ec7e37f2c1.tar.gz
dwm-flexipatch-6de03c1735b272a8081ffc8a25e078ec7e37f2c1.zip
Adding transferall patch
Diffstat (limited to 'patch/transferall.c')
-rw-r--r--patch/transferall.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/patch/transferall.c b/patch/transferall.c
new file mode 100644
index 0000000..fe12699
--- /dev/null
+++ b/patch/transferall.c
@@ -0,0 +1,25 @@
+void
+transferall(const Arg *arg)
+{
+ Client *c, *n = selmon->clients, *attachfrom = NULL;
+ int i = 0, nstackclients = 0;
+ while (n) {
+ c = n;
+ n = c->next;
+ if (!ISVISIBLE(c) || c->isfloating) continue;
+ if (i >= selmon->nmaster) {
+ detach(c);
+ if (!attachfrom) {
+ attach(c);
+ } else {
+ c->next = attachfrom->next;
+ attachfrom->next = c;
+ }
+ attachfrom = c;
+ nstackclients++;
+ }
+ i++;
+ }
+ selmon->nmaster = nstackclients;
+ arrange(selmon);
+} \ No newline at end of file