diff --git a/_STALE_PATCHES/dragmfact.md b/_STALE_PATCHES/dragmfact.md deleted file mode 100644 index d86f2d5..0000000 --- a/_STALE_PATCHES/dragmfact.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description -Change mfact by dragging the mouse. - -### Download -- [2022-12-03](https://github.com/djpohly/dwl/compare/main...PalanixYT:dragmfact.patch) - -### Authors -- [Palanix](https://github.com/PalanixYT) \ No newline at end of file diff --git a/dragmfact/dragmfact.patch b/dragmfact/dragmfact.patch new file mode 100644 index 0000000..f248d16 --- /dev/null +++ b/dragmfact/dragmfact.patch @@ -0,0 +1,59 @@ +From 24e67acd6c123481b9248385aba305e3cfd433ac 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 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..8fa2e22 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 = 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 = cursor->x / selmon->m.width; ++ arrange(selmon); + } + } + +-- +2.43.2 +