diff options
| -rw-r--r-- | patches/sticky/README.md | 14 | ||||
| -rw-r--r-- | patches/sticky/sticky.patch | 85 |
2 files changed, 99 insertions, 0 deletions
diff --git a/patches/sticky/README.md b/patches/sticky/README.md new file mode 100644 index 0000000..4f1b36d --- /dev/null +++ b/patches/sticky/README.md @@ -0,0 +1,14 @@ +### Description +Adds a toggleable function that makes a sticky client that is visible on all tags. + +Originally based on [dwm sticky patch](https://dwm.suckless.org/patches/sticky). + +### Download +- [v0.8](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/sticky/sticky.patch) +- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/commit/898bc7a946c7be14034a665bd7a7b042632465ea/patches/sticky/sticky.patch) +- [v0.4](https://github.com/djpohly/dwl/compare/main...dm1tz:04-sticky.patch) +- [git branch](https://codeberg.org/Rutherther/dwl/src/branch/v0.7/sticky) + +### Authors +- [Rutherther](https://codeberg.org/Rutherther) +- [Dmitry Zakharchenko](https://github.com/dm1tz) diff --git a/patches/sticky/sticky.patch b/patches/sticky/sticky.patch new file mode 100644 index 0000000..f0cd55d --- /dev/null +++ b/patches/sticky/sticky.patch @@ -0,0 +1,85 @@ +From d36eee35fdc4b0e666fb04a580200e8c5d2b1f9e Mon Sep 17 00:00:00 2001 +From: nate zhou <gnuunixchad@outlook.com> +Date: Sat, 28 Feb 2026 22:55:33 +0800 +Subject: [PATCH] Update sticky patch to v0.8 + +--- + dwl.c | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +diff --git a/dwl.c b/dwl.c +index 44f3ad9..05070ef 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -74,7 +74,7 @@ + #define MAX(A, B) ((A) > (B) ? (A) : (B)) + #define MIN(A, B) ((A) < (B) ? (A) : (B)) + #define CLEANMASK(mask) (mask & ~WLR_MODIFIER_CAPS) +-#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags])) ++#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && (((C)->tags & (M)->tagset[(M)->seltags]) || C->issticky)) + #define LENGTH(X) (sizeof X / sizeof X[0]) + #define END(A) ((A) + LENGTH(A)) + #define TAGMASK ((1u << TAGCOUNT) - 1) +@@ -137,7 +137,7 @@ typedef struct { + #endif + unsigned int bw; + uint32_t tags; +- int isfloating, isurgent, isfullscreen; ++ int isfloating, isurgent, isfullscreen, issticky; + uint32_t resize; /* configure serial of a pending resize */ + } Client; + +@@ -323,6 +323,7 @@ static void setcursor(struct wl_listener *listener, void *data); + static void setcursorshape(struct wl_listener *listener, void *data); + static void setfloating(Client *c, int floating); + static void setfullscreen(Client *c, int fullscreen); ++static void setsticky(Client *c, int sticky); + static void setlayout(const Arg *arg); + static void setmfact(const Arg *arg); + static void setmon(Client *c, Monitor *m, uint32_t newtags); +@@ -335,6 +336,7 @@ static void tag(const Arg *arg); + static void tagmon(const Arg *arg); + static void tile(Monitor *m); + static void togglefloating(const Arg *arg); ++static void togglesticky(const Arg *arg); + static void togglefullscreen(const Arg *arg); + static void toggletag(const Arg *arg); + static void toggleview(const Arg *arg); +@@ -2368,6 +2370,17 @@ setfullscreen(Client *c, int fullscreen) + printstatus(); + } + ++void ++setsticky(Client *c, int sticky) ++{ ++ if(sticky && !c->issticky) { ++ c->issticky = 1; ++ } else if(!sticky && c->issticky) { ++ c->issticky = 0; ++ arrange(c->mon); ++ } ++} ++ + void + setlayout(const Arg *arg) + { +@@ -2760,6 +2773,16 @@ togglefullscreen(const Arg *arg) + setfullscreen(sel, !sel->isfullscreen); + } + ++void ++togglesticky(const Arg *arg) ++{ ++ Client *c = focustop(selmon); ++ if(!c) ++ return; ++ ++ setsticky(c, !c->issticky); ++} ++ + void + toggletag(const Arg *arg) + { +-- +2.53.0 + |
