summaryrefslogtreecommitdiffhomepage
path: root/patch/bar_awesomebar.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-08-04 13:40:26 +0200
committerbakkeby <[email protected]>2020-08-04 13:40:26 +0200
commit3f4f88c1428c8f2057488daa34fe7d4c131d9594 (patch)
tree32a6153e8decde86458e3d1e208e90e2c6fecbd7 /patch/bar_awesomebar.c
parent12527f00d96d92718bcf996d3ed4d0c325b8c622 (diff)
downloaddwm-flexipatch-3f4f88c1428c8f2057488daa34fe7d4c131d9594.tar.gz
dwm-flexipatch-3f4f88c1428c8f2057488daa34fe7d4c131d9594.zip
awesomebar: use previously tiled when hiding client and the hidden client was the last tiled client
Diffstat (limited to 'patch/bar_awesomebar.c')
-rw-r--r--patch/bar_awesomebar.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/patch/bar_awesomebar.c b/patch/bar_awesomebar.c
index 5a3a588..75155fb 100644
--- a/patch/bar_awesomebar.c
+++ b/patch/bar_awesomebar.c
@@ -116,7 +116,7 @@ hide(Client *c) {
} else {
n = nexttiled(c);
if (!n)
- n = nexttiled(c->mon->clients);
+ n = prevtiled(c);
}
focus(n);
arrange(c->mon);
@@ -149,6 +149,16 @@ togglewin(const Arg *arg)
}
}
+Client *
+prevtiled(Client *c)
+{
+ Client *p, *i;
+ for (p = NULL, i = c->mon->clients; c && i != c; i = i->next)
+ if (ISVISIBLE(i) && !HIDDEN(i))
+ p = i;
+ return p;
+}
+
void
showhideclient(const Arg *arg)
{