From 3940eaa6a4eede6a4f101bf3dd72db12a6376ff6 Mon Sep 17 00:00:00 2001 From: Palanix Date: Fri, 25 Sep 2026 18:25:18 +0200 Subject: [PATCH] Update dragmfact to v0.9 --- patches/dragmfact/README.md | 1 + patches/dragmfact/dragmfact-v0.9.patch | 60 ++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 patches/dragmfact/dragmfact-v0.9.patch diff --git a/patches/dragmfact/README.md b/patches/dragmfact/README.md index 3112d44..914a5b3 100644 --- a/patches/dragmfact/README.md +++ b/patches/dragmfact/README.md @@ -3,6 +3,7 @@ Change mfact by dragging the mouse. ### Download - [git branch](https://codeberg.org/Palanix/dwl/src/branch/dragmfact) +- [v0.9](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/dragmfact/dragmfact-v0.9.patch) - [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) diff --git a/patches/dragmfact/dragmfact-v0.9.patch b/patches/dragmfact/dragmfact-v0.9.patch new file mode 100644 index 0000000..09feed7 --- /dev/null +++ b/patches/dragmfact/dragmfact-v0.9.patch @@ -0,0 +1,60 @@ +From e0bec95eb6527dc5b87244ba025b28d2eaac94fe Mon Sep 17 00:00:00 2001 +From: Palanix +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 13c5322..ddce20b 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -167,7 +167,7 @@ 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 4cfd0fd..1eb98c2 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -86,7 +86,7 @@ + #define LISTEN_STATIC(E, H) do { struct wl_listener *_l = ecalloc(1, sizeof(*_l)); _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, LyrUnmanaged, LyrOverlay, + LyrIMPopup, LyrBlock, NUM_LAYERS }; /* scene layers */ +@@ -2077,6 +2077,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 +@@ -2128,6 +2131,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.55.0 +