diff options
author | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:41:09 +0000 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-05-23 11:41:09 +0000 |
commit | c70505d7c7b7b48600f273357694b56ccf5d2a15 (patch) | |
tree | 21c27ac6ffced8d6d904e35bdb39baa5d685d829 /dwl-patches/patches/dragmfact | |
download | dotfiles-c70505d7c7b7b48600f273357694b56ccf5d2a15.tar.gz dotfiles-c70505d7c7b7b48600f273357694b56ccf5d2a15.tar.bz2 dotfiles-c70505d7c7b7b48600f273357694b56ccf5d2a15.zip |
Diffstat (limited to 'dwl-patches/patches/dragmfact')
-rw-r--r-- | dwl-patches/patches/dragmfact/README.md | 11 | ||||
-rw-r--r-- | dwl-patches/patches/dragmfact/dragmfact-v0.6.patch | 59 | ||||
-rw-r--r-- | dwl-patches/patches/dragmfact/dragmfact-v0.7.patch | 59 | ||||
-rw-r--r-- | dwl-patches/patches/dragmfact/dragmfact.patch | 59 |
4 files changed, 188 insertions, 0 deletions
diff --git a/dwl-patches/patches/dragmfact/README.md b/dwl-patches/patches/dragmfact/README.md new file mode 100644 index 0000000..3112d44 --- /dev/null +++ b/dwl-patches/patches/dragmfact/README.md @@ -0,0 +1,11 @@ +### Description +Change mfact by dragging the mouse. + +### Download +- [git branch](https://codeberg.org/Palanix/dwl/src/branch/dragmfact) +- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/dragmfact/dragmfact-v0.7.patch) +- [v0.6](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/dragmfact/dragmfact-v0.6.patch) +- [2024-02-16](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/dragmfact/dragmfact.patch) + +### Authors +- [Palanix](https://codeberg.org/Palanix) diff --git a/dwl-patches/patches/dragmfact/dragmfact-v0.6.patch b/dwl-patches/patches/dragmfact/dragmfact-v0.6.patch new file mode 100644 index 0000000..2435cbf --- /dev/null +++ b/dwl-patches/patches/dragmfact/dragmfact-v0.6.patch @@ -0,0 +1,59 @@ +From aeee958aec3e0774f3ea8baefe028e1a8cc2d2ce Mon Sep 17 00:00:00 2001 +From: Palanix <palanixyt@gmail.com> +Date: Fri, 25 Mar 2022 23:45:10 +0100 +Subject: [PATCH] Change mfact using Middle mouse + +--- + config.def.h | 2 +- + dwl.c | 9 ++++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 22d2171..c9071a5 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -171,6 +171,6 @@ static const Key keys[] = { + + static const Button buttons[] = { + { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} }, +- { MODKEY, BTN_MIDDLE, togglefloating, {0} }, ++ { MODKEY, BTN_MIDDLE, moveresize, {.ui = Curmfact} }, + { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} }, + }; +diff --git a/dwl.c b/dwl.c +index 145fd01..0a3d140 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -80,7 +80,7 @@ + #define LISTEN_STATIC(E, H) do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0) + + /* enums */ +-enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */ ++enum { CurNormal, CurPressed, CurMove, CurResize, Curmfact }; /* cursor */ + enum { XDGShell, LayerShell, X11 }; /* client types */ + enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */ + #ifdef XWAYLAND +@@ -1823,6 +1823,9 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d + resize(grabc, (struct wlr_box){.x = grabc->geom.x, .y = grabc->geom.y, + .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}, 1); + return; ++ } else if (cursor_mode == Curmfact && time) { ++ selmon->mfact = (float) (cursor->x / selmon->m.width); ++ arrange(selmon); + } + + /* If there's no client surface under the cursor, set the cursor image to a +@@ -1874,6 +1877,10 @@ moveresize(const Arg *arg) + grabc->geom.y + grabc->geom.height); + wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize"); + break; ++ case Curmfact: ++ setfloating(grabc, 0); ++ selmon->mfact = (float) (cursor->x / selmon->m.width); ++ arrange(selmon); + } + } + +-- +2.45.2 + diff --git a/dwl-patches/patches/dragmfact/dragmfact-v0.7.patch b/dwl-patches/patches/dragmfact/dragmfact-v0.7.patch new file mode 100644 index 0000000..f0ea5d3 --- /dev/null +++ b/dwl-patches/patches/dragmfact/dragmfact-v0.7.patch @@ -0,0 +1,59 @@ +From ae44bfc181fc1532d2f0c4deb20e20634050a661 Mon Sep 17 00:00:00 2001 +From: Palanix <palanixyt@gmail.com> +Date: Fri, 25 Mar 2022 23:45:10 +0100 +Subject: [PATCH] Change mfact using Middle mouse + +--- + config.def.h | 2 +- + dwl.c | 9 ++++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 22d2171..c9071a5 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -171,6 +171,6 @@ static const Key keys[] = { + + static const Button buttons[] = { + { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} }, +- { MODKEY, BTN_MIDDLE, togglefloating, {0} }, ++ { MODKEY, BTN_MIDDLE, moveresize, {.ui = Curmfact} }, + { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} }, + }; +diff --git a/dwl.c b/dwl.c +index 5bf995e..dfb0754 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -81,7 +81,7 @@ + #define LISTEN_STATIC(E, H) do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0) + + /* enums */ +-enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */ ++enum { CurNormal, CurPressed, CurMove, CurResize, Curmfact }; /* cursor */ + enum { XDGShell, LayerShell, X11 }; /* client types */ + enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrTop, LyrFS, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */ + #ifdef XWAYLAND +@@ -1872,6 +1872,9 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d + resize(grabc, (struct wlr_box){.x = grabc->geom.x, .y = grabc->geom.y, + .width = (int)round(cursor->x) - grabc->geom.x, .height = (int)round(cursor->y) - grabc->geom.y}, 1); + return; ++ } else if (cursor_mode == Curmfact && time) { ++ selmon->mfact = (float) (cursor->x / selmon->m.width); ++ arrange(selmon); + } + + /* If there's no client surface under the cursor, set the cursor image to a +@@ -1923,6 +1926,10 @@ moveresize(const Arg *arg) + grabc->geom.y + grabc->geom.height); + wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize"); + break; ++ case Curmfact: ++ setfloating(grabc, 0); ++ selmon->mfact = (float) (cursor->x / selmon->m.width); ++ arrange(selmon); + } + } + +-- +2.45.2 + diff --git a/dwl-patches/patches/dragmfact/dragmfact.patch b/dwl-patches/patches/dragmfact/dragmfact.patch new file mode 100644 index 0000000..e2fdbac --- /dev/null +++ b/dwl-patches/patches/dragmfact/dragmfact.patch @@ -0,0 +1,59 @@ +From 435cdf673e5a8080123109dbf874aac2ccef1498 Mon Sep 17 00:00:00 2001 +From: Palanix <palanixyt@gmail.com> +Date: Fri, 25 Mar 2022 23:45:10 +0100 +Subject: [PATCH] Change mfact using Middle mouse + +--- + config.def.h | 2 +- + dwl.c | 9 ++++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 9009517..3c26522 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -166,6 +166,6 @@ static const Key keys[] = { + + static const Button buttons[] = { + { MODKEY, BTN_LEFT, moveresize, {.ui = CurMove} }, +- { MODKEY, BTN_MIDDLE, togglefloating, {0} }, ++ { MODKEY, BTN_MIDDLE, moveresize, {.ui = Curmfact} }, + { MODKEY, BTN_RIGHT, moveresize, {.ui = CurResize} }, + }; +diff --git a/dwl.c b/dwl.c +index fa76db2..528e102 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -76,7 +76,7 @@ + #define LISTEN_STATIC(E, H) do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0) + + /* enums */ +-enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */ ++enum { CurNormal, CurPressed, CurMove, CurResize, Curmfact }; /* cursor */ + enum { XDGShell, LayerShell, X11 }; /* client types */ + enum { LyrBg, LyrBottom, LyrTile, LyrFloat, LyrFS, LyrTop, LyrOverlay, LyrBlock, NUM_LAYERS }; /* scene layers */ + #ifdef XWAYLAND +@@ -1639,6 +1639,9 @@ motionnotify(uint32_t time) + resize(grabc, (struct wlr_box){.x = grabc->geom.x, .y = grabc->geom.y, + .width = ROUND(cursor->x) - grabc->geom.x, .height = ROUND(cursor->y) - grabc->geom.y}, 1); + return; ++ } else if (cursor_mode == Curmfact && time) { ++ selmon->mfact = (float) (cursor->x / selmon->m.width); ++ arrange(selmon); + } + + /* Find the client under the pointer and send the event along. */ +@@ -1701,6 +1704,10 @@ moveresize(const Arg *arg) + grabc->geom.y + grabc->geom.height); + wlr_cursor_set_xcursor(cursor, cursor_mgr, "se-resize"); + break; ++ case Curmfact: ++ setfloating(grabc, 0); ++ selmon->mfact = (float) (cursor->x / selmon->m.width); ++ arrange(selmon); + } + } + +-- +2.43.2 + |