commit 4b4a3ecf05489710cf48174faa85f9473e17b386
parent 3d8753cc0a0b5936655779985f2eb17615a986c4
Author: matthewq337 <mattquintanilla45@gmail.com>
Date: Fri, 13 Oct 2023 18:11:00 +0000
made it work for more just one
Diffstat:
2 files changed, 108 insertions(+), 2 deletions(-)
diff --git a/dwm.suckless.org/patches/alwaysontop/alwaysontopall-6.2.diff b/dwm.suckless.org/patches/alwaysontop/alwaysontopall-6.2.diff
@@ -0,0 +1,103 @@
+From 9cd160c4ba9c345c24644a7da77cc4f04fc93c4e Mon Sep 17 00:00:00 2001
+From: Matt Quintanilla <matt@mattquintanilla.xyz>
+Date: Fri, 13 Oct 2023 20:11:08 +0100
+Subject: [PATCH] alwaysontop for all
+
+---
+ config.def.h | 1 +
+ dwm.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
+ 2 files changed, 44 insertions(+), 2 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..c3c7edd 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -78,6 +78,7 @@ static Key keys[] = {
+ { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_space, setlayout, {0} },
+ { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
++ { MODKEY|ShiftMask, XK_space, togglealwaysontop, {0} },
+ { MODKEY, XK_0, view, {.ui = ~0 } },
+ { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
+ { MODKEY, XK_comma, focusmon, {.i = -1 } },
+diff --git a/dwm.c b/dwm.c
+index 4465af1..8d54b26 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -92,7 +92,7 @@ struct Client {
+ int basew, baseh, incw, inch, maxw, maxh, minw, minh;
+ int bw, oldbw;
+ unsigned int tags;
+- int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
++ int isfixed, iscentered, isfloating, isalwaysontop, isurgent, neverfocus, oldstate, isfullscreen;
+ Client *next;
+ Client *snext;
+ Monitor *mon;
+@@ -211,6 +211,7 @@ static void tagmon(const Arg *arg);
+ static void tile(Monitor *);
+ static void togglebar(const Arg *arg);
+ static void togglefloating(const Arg *arg);
++static void togglealwaysontop(const Arg *arg);
+ static void toggletag(const Arg *arg);
+ static void toggleview(const Arg *arg);
+ static void unfocus(Client *c, int setfocus);
+@@ -732,8 +733,11 @@ drawbar(Monitor *m)
+ if (m->sel) {
+ drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
+ drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
+- if (m->sel->isfloating)
++ if (m->sel->isfloating) {
+ drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
++ if (m->sel->isalwaysontop)
++ drw_rect(drw, x + boxs, bh - boxw, boxw, boxw, 0, 0);
++ }
+ } else {
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ drw_rect(drw, x, 0, w, bh, 1, 1);
+@@ -1356,6 +1360,17 @@ restack(Monitor *m)
+ return;
+ if (m->sel->isfloating || !m->lt[m->sellt]->arrange)
+ XRaiseWindow(dpy, m->sel->win);
++
++ /* raise the aot window */
++ for(Monitor *m_search = mons; m_search; m_search = m_search->next){
++ for(c = m_search->clients; c; c = c->next){
++ if(c->isalwaysontop){
++ XRaiseWindow(dpy, c->win);
++ }
++ }
++ }
++
+ if (m->lt[m->sellt]->arrange) {
+ wc.stack_mode = Below;
+ wc.sibling = m->barwin;
+@@ -1716,6 +1731,32 @@ togglefloating(const Arg *arg)
+ if (selmon->sel->isfloating)
+ resize(selmon->sel, selmon->sel->x, selmon->sel->y,
+ selmon->sel->w, selmon->sel->h, 0);
++ else
++ selmon->sel->isalwaysontop = 0; /* disabled, turn this off too */
++ arrange(selmon);
++}
++
++void
++togglealwaysontop(const Arg *arg)
++{
++ if (!selmon->sel)
++ return;
++ if (selmon->sel->isfullscreen)
++ return;
++
++ if(selmon->sel->isalwaysontop){
++ selmon->sel->isalwaysontop = 0;
++ }else{
++ c->isalwaysontop = 0;
++
++ }
++
+ arrange(selmon);
+ }
+
+--
+2.31.1
+
diff --git a/dwm.suckless.org/patches/alwaysontop/index.md b/dwm.suckless.org/patches/alwaysontop/index.md
@@ -5,11 +5,13 @@ Description
-----------
Choose one floating window to be always-on-top - this prevents other floating
windows from being raised above it. Useful for playing films, etc.
-
+----------
+Updates
+* 2023-10-13 made it work so that any window you specify is ontop not just the one
Download
--------
* [alwaysontop-6.2.diff](alwaysontop-6.2.diff)
-
+* [alwaysontopall-6.2.diff](alwaysontopall-6.2.diff)
Example Configuration
---------------------
Add the following to your keys array to bind mod+tab to toggle attach below.
@@ -19,3 +21,4 @@ Add the following to your keys array to bind mod+tab to toggle attach below.
Author
------
* Rob Pilling - <robpilling@gmail.com>
+* Matt Quintanilla - <mattquintanilla45@gmail.com>