diff options
author | Schark <jordan@schark.online> | 2025-03-06 01:09:39 -0500 |
---|---|---|
committer | Schark <jordan@schark.online> | 2025-03-06 01:09:39 -0500 |
commit | a5b3829c3f16842ad34a97cd27c771d705e51003 (patch) | |
tree | 7b0b0a3e4f2165febdf59ef4dc146b5166b07180 /suckless/dwm/dwm.c | |
parent | aece9630cf864dc2e20364e447d7b087ab59a958 (diff) | |
download | dotfiles-a5b3829c3f16842ad34a97cd27c771d705e51003.tar.gz dotfiles-a5b3829c3f16842ad34a97cd27c771d705e51003.zip |
Diffstat (limited to 'suckless/dwm/dwm.c')
-rw-r--r-- | suckless/dwm/dwm.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/suckless/dwm/dwm.c b/suckless/dwm/dwm.c index d99d6d5..e525220 100644 --- a/suckless/dwm/dwm.c +++ b/suckless/dwm/dwm.c @@ -49,7 +49,7 @@ #define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) +#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]) || C->ispinned) #define LENGTH(X) (sizeof X / sizeof X[0]) #define MOUSEMASK (BUTTONMASK|PointerMotionMask) #define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx) @@ -92,7 +92,7 @@ struct Client { int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid; int bw, oldbw; unsigned int tags; - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; + int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, ispinned; int floatborderpx; int hasfloatbw; Client *next; @@ -217,6 +217,7 @@ static void tagmon(const Arg *arg); static void tile(Monitor *m); static void togglebar(const Arg *arg); static void togglefloating(const Arg *arg); +static void togglepin(const Arg *arg); static void togglescratch(const Arg *arg); static void toggletag(const Arg *arg); static void toggleview(const Arg *arg); @@ -759,6 +760,8 @@ drawbar(Monitor *m) drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); if (m->sel->isfloating) drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); + if (m->sel->ispinned) + drw_rect(drw, x + boxs + 2 * boxw, boxs, boxw, boxw, 1, 0); } else { drw_setscheme(drw, scheme[SchemeNorm]); drw_rect(drw, x, 0, w, bh, 1, 1); @@ -1079,6 +1082,7 @@ manage(Window w, XWindowAttributes *wa) c->x = MAX(c->x, c->mon->wx); c->y = MAX(c->y, c->mon->wy); c->bw = borderpx; + c->ispinned = 0; selmon->tagset[selmon->seltags] &= ~scratchtag; if (!strcmp(c->name, scratchpadname)) { @@ -1896,6 +1900,15 @@ togglescratch(const Arg *arg) } void +togglepin(const Arg *arg) +{ + if (!selmon->sel) + return; + selmon->sel->ispinned = !selmon->sel->ispinned; + arrange(selmon); +} + +void toggletag(const Arg *arg) { unsigned int newtags; |