diff options
Diffstat (limited to 'dwl-patches/patches/zoomswap')
-rw-r--r-- | dwl-patches/patches/zoomswap/README.md | 54 | ||||
-rw-r--r-- | dwl-patches/patches/zoomswap/zoomswap-v0.6.patch | 55 | ||||
-rw-r--r-- | dwl-patches/patches/zoomswap/zoomswap-v0.7.patch | 55 | ||||
-rw-r--r-- | dwl-patches/patches/zoomswap/zoomswap.patch | 55 |
4 files changed, 219 insertions, 0 deletions
diff --git a/dwl-patches/patches/zoomswap/README.md b/dwl-patches/patches/zoomswap/README.md new file mode 100644 index 0000000..83cbeb1 --- /dev/null +++ b/dwl-patches/patches/zoomswap/README.md @@ -0,0 +1,54 @@ +### Description +This patch swaps the current window (C) with the previous master (P) when zooming. +``` +Original behaviour : ++-----------------+-------+ +| | | +| | | +| | | +| P +-------| +| | | +| | C | +| | | ++-----------------+-------+ + ++-----------------+-------+ +| | | +| | P | +| | | +| C +-------| +| | | +| | | +| | | ++-----------------+-------+ + +New Behaviour : ++-----------------+-------+ +| | | +| | | +| | | +| C +-------+ +| | | +| | P | +| | | ++-----------------+-------+ + ++-----------------+-------+ +| | | +| | | +| | | +| P +-------+ +| | | +| | C | +| | | ++-----------------+-------+ +``` + +### Download +- [git branch](https://codeberg.org/Palanix/dwl/src/branch/zoomswap) +- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/zoomswap/zoomswap-v0.7.patch) +- [v0.6](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/zoomswap/zoomswap-v0.6.patch) +- [2024-02-15](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/zoomswap/zoomswap.patch) + +### Authors +- [Palanix](https://codeberg.org/Palanix) diff --git a/dwl-patches/patches/zoomswap/zoomswap-v0.6.patch b/dwl-patches/patches/zoomswap/zoomswap-v0.6.patch new file mode 100644 index 0000000..93de288 --- /dev/null +++ b/dwl-patches/patches/zoomswap/zoomswap-v0.6.patch @@ -0,0 +1,55 @@ +From 2b4e1a8bbb2d17a3da5ca54f2995469dfec5bbbb Mon Sep 17 00:00:00 2001 +From: Palanix <palanixyt@gmail.com> +Date: Fri, 28 Jul 2023 02:14:32 +0200 +Subject: [PATCH] Implement zoomswap + +--- + dwl.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/dwl.c b/dwl.c +index 145fd01..e84202c 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -207,6 +207,7 @@ struct Monitor { + int nmaster; + char ltsymbol[16]; + int asleep; ++ Client *prevc; + }; + + typedef struct { +@@ -943,6 +944,7 @@ createmon(struct wl_listener *listener, void *data) + + m = wlr_output->data = ecalloc(1, sizeof(*m)); + m->wlr_output = wlr_output; ++ m->prevc = NULL; + + for (i = 0; i < LENGTH(m->layers); i++) + wl_list_init(&m->layers[i]); +@@ -2968,7 +2970,7 @@ xytonode(double x, double y, struct wlr_surface **psurface, + void + zoom(const Arg *arg) + { +- Client *c, *sel = focustop(selmon); ++ Client *c, *sel = focustop(selmon), *tmp = sel; + + if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating) + return; +@@ -2990,9 +2992,12 @@ zoom(const Arg *arg) + /* If we passed sel, move c to the front; otherwise, move sel to the + * front */ + if (!sel) +- sel = c; ++ sel = selmon->prevc ? selmon->prevc : c, c = tmp; ++ wl_list_remove(&c->link); ++ wl_list_insert(&sel->link, &c->link); + wl_list_remove(&sel->link); + wl_list_insert(&clients, &sel->link); ++ selmon->prevc = c; + + focusclient(sel, 1); + arrange(selmon); +-- +2.45.2 + diff --git a/dwl-patches/patches/zoomswap/zoomswap-v0.7.patch b/dwl-patches/patches/zoomswap/zoomswap-v0.7.patch new file mode 100644 index 0000000..d20ff32 --- /dev/null +++ b/dwl-patches/patches/zoomswap/zoomswap-v0.7.patch @@ -0,0 +1,55 @@ +From cd4ce3f98b4231515c1363070a7fb5f9654a40bc Mon Sep 17 00:00:00 2001 +From: Palanix <palanixyt@gmail.com> +Date: Fri, 28 Jul 2023 02:14:32 +0200 +Subject: [PATCH] Implement zoomswap + +--- + dwl.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/dwl.c b/dwl.c +index 5bf995e..4e2b44e 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -208,6 +208,7 @@ struct Monitor { + int nmaster; + char ltsymbol[16]; + int asleep; ++ Client *prevc; + }; + + typedef struct { +@@ -984,6 +985,7 @@ createmon(struct wl_listener *listener, void *data) + + m = wlr_output->data = ecalloc(1, sizeof(*m)); + m->wlr_output = wlr_output; ++ m->prevc = NULL; + + for (i = 0; i < LENGTH(m->layers); i++) + wl_list_init(&m->layers[i]); +@@ -3023,7 +3025,7 @@ xytonode(double x, double y, struct wlr_surface **psurface, + void + zoom(const Arg *arg) + { +- Client *c, *sel = focustop(selmon); ++ Client *c, *sel = focustop(selmon), *tmp = sel; + + if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating) + return; +@@ -3045,9 +3047,12 @@ zoom(const Arg *arg) + /* If we passed sel, move c to the front; otherwise, move sel to the + * front */ + if (!sel) +- sel = c; ++ sel = selmon->prevc ? selmon->prevc : c, c = tmp; ++ wl_list_remove(&c->link); ++ wl_list_insert(&sel->link, &c->link); + wl_list_remove(&sel->link); + wl_list_insert(&clients, &sel->link); ++ selmon->prevc = c; + + focusclient(sel, 1); + arrange(selmon); +-- +2.45.2 + diff --git a/dwl-patches/patches/zoomswap/zoomswap.patch b/dwl-patches/patches/zoomswap/zoomswap.patch new file mode 100644 index 0000000..76e4466 --- /dev/null +++ b/dwl-patches/patches/zoomswap/zoomswap.patch @@ -0,0 +1,55 @@ +From c82be3e2069fdb9cbea0da22a4c9ed69f4ab5aea Mon Sep 17 00:00:00 2001 +From: Palanix <palanixyt@gmail.com> +Date: Fri, 28 Jul 2023 02:14:32 +0200 +Subject: [PATCH] Implement zoomswap + +--- + dwl.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/dwl.c b/dwl.c +index fa76db2..1dea8fe 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -202,6 +202,7 @@ struct Monitor { + int gamma_lut_changed; + int nmaster; + char ltsymbol[16]; ++ Client *prevc; + }; + + typedef struct { +@@ -858,6 +859,7 @@ createmon(struct wl_listener *listener, void *data) + + m = wlr_output->data = ecalloc(1, sizeof(*m)); + m->wlr_output = wlr_output; ++ m->prevc = NULL; + + for (i = 0; i < LENGTH(m->layers); i++) + wl_list_init(&m->layers[i]); +@@ -2793,7 +2795,7 @@ xytonode(double x, double y, struct wlr_surface **psurface, + void + zoom(const Arg *arg) + { +- Client *c, *sel = focustop(selmon); ++ Client *c, *sel = focustop(selmon), *tmp = sel; + + if (!sel || !selmon || !selmon->lt[selmon->sellt]->arrange || sel->isfloating) + return; +@@ -2815,9 +2817,12 @@ zoom(const Arg *arg) + /* If we passed sel, move c to the front; otherwise, move sel to the + * front */ + if (!sel) +- sel = c; ++ sel = selmon->prevc ? selmon->prevc : c, c = tmp; ++ wl_list_remove(&c->link); ++ wl_list_insert(&sel->link, &c->link); + wl_list_remove(&sel->link); + wl_list_insert(&clients, &sel->link); ++ selmon->prevc = c; + + focusclient(sel, 1); + arrange(selmon); +-- +2.43.1 + |