summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2021-02-17 14:37:20 +0100
committerbakkeby <[email protected]>2021-02-17 14:37:20 +0100
commit15895c42b9baab8ba91b8e0a9c9b61180b1cb48c (patch)
tree9e9b17b051d0af881a538a9afe8dcdb980d4a7c8
parent7f256e2d3cc5bfc2947975f38cfbcced474a9e06 (diff)
downloaddwm-flexipatch-15895c42b9baab8ba91b8e0a9c9b61180b1cb48c.tar.gz
dwm-flexipatch-15895c42b9baab8ba91b8e0a9c9b61180b1cb48c.zip
stacker: addressing wintitleactions (awesomebar hidden clients) compatibility issue ref. #94
-rw-r--r--patch/stacker.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/patch/stacker.c b/patch/stacker.c
index dc16d49..1582cf6 100644
--- a/patch/stacker.c
+++ b/patch/stacker.c
@@ -12,8 +12,13 @@ focusstack(const Arg *arg)
return;
#endif // ALWAYSFULLSCREEN_PATCH
+ #if BAR_WINTITLEACTIONS_PATCH
+ for (p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c) || HIDDEN(c));
+ i -= (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), p = c, c = c->next);
+ #else
for (p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c));
- i -= ISVISIBLE(c) ? 1 : 0, p = c, c = c->next);
+ i -= (ISVISIBLE(c) ? 1 : 0), p = c, c = c->next);
+ #endif // BAR_WINTITLEACTIONS_PATCH
focus(c ? c : p);
restack(selmon);
}
@@ -32,7 +37,11 @@ pushstack(const Arg *arg)
}
else {
for (p = NULL, c = selmon->clients; c; p = c, c = c->next)
+ #if BAR_WINTITLEACTIONS_PATCH
+ if (!(i -= (ISVISIBLE(c) && !HIDDEN(c) && c != sel)))
+ #else
if (!(i -= (ISVISIBLE(c) && c != sel)))
+ #endif // BAR_WINTITLEACTIONS_PATCH
break;
c = c ? c : p;
detach(sel);
@@ -51,24 +60,47 @@ stackpos(const Arg *arg)
if (!selmon->clients)
return -1;
+ #if BAR_WINTITLEACTIONS_PATCH
+ if (arg->i == PREVSEL) {
+ for (l = selmon->stack; l && (!ISVISIBLE(l) || HIDDEN(l) || l == selmon->sel); l = l->snext);
+ if (!l)
+ return -1;
+ for (i = 0, c = selmon->clients; c != l; i += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next);
+ return i;
+ }
+ else if (ISINC(arg->i)) {
+ if (!selmon->sel)
+ return -1;
+ for (i = 0, c = selmon->clients; c != selmon->sel; i += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next);
+ for (n = i; c; n += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next);
+ return MOD(i + GETINC(arg->i), n);
+ }
+ else if (arg->i < 0) {
+ for (i = 0, c = selmon->clients; c; i += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next);
+ return MAX(i + arg->i, 0);
+ }
+ else
+ return arg->i;
+ #else // !BAR_WINTITLEACTIONS_PATCH
if (arg->i == PREVSEL) {
for (l = selmon->stack; l && (!ISVISIBLE(l) || l == selmon->sel); l = l->snext);
if (!l)
return -1;
- for (i = 0, c = selmon->clients; c != l; i += ISVISIBLE(c) ? 1 : 0, c = c->next);
+ for (i = 0, c = selmon->clients; c != l; i += (ISVISIBLE(c) ? 1 : 0), c = c->next);
return i;
}
else if (ISINC(arg->i)) {
if (!selmon->sel)
return -1;
- for (i = 0, c = selmon->clients; c != selmon->sel; i += ISVISIBLE(c) ? 1 : 0, c = c->next);
- for (n = i; c; n += ISVISIBLE(c) ? 1 : 0, c = c->next);
+ for (i = 0, c = selmon->clients; c != selmon->sel; i += (ISVISIBLE(c) ? 1 : 0), c = c->next);
+ for (n = i; c; n += (ISVISIBLE(c) ? 1 : 0), c = c->next);
return MOD(i + GETINC(arg->i), n);
}
else if (arg->i < 0) {
- for (i = 0, c = selmon->clients; c; i += ISVISIBLE(c) ? 1 : 0, c = c->next);
+ for (i = 0, c = selmon->clients; c; i += (ISVISIBLE(c) ? 1 : 0), c = c->next);
return MAX(i + arg->i, 0);
}
else
return arg->i;
+ #endif // BAR_WINTITLEACTIONS_PATCH
}