summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-05-27 14:10:51 +0200
committerbakkeby <[email protected]>2020-05-27 14:10:51 +0200
commit1bf50728a7acaba9ed32d423b4118d52db274f39 (patch)
tree40f47859c8a3b5a6c1a1bb70a1072430f45f0501
parente79aec52c28af424adf4b31ff5d4504303c61383 (diff)
downloaddwm-flexipatch-1bf50728a7acaba9ed32d423b4118d52db274f39.tar.gz
dwm-flexipatch-1bf50728a7acaba9ed32d423b4118d52db274f39.zip
Awesomebar: dwm crashes on bar click with 0 clients
Clicking on the bar before any clients have been started results in dwm crashing. This fix addresses that.
-rw-r--r--dwm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index 17c95fd..15822f3 100644
--- a/dwm.c
+++ b/dwm.c
@@ -937,11 +937,11 @@ buttonpress(XEvent *e)
c = m->clients;
do {
- if (!ISVISIBLE(c))
+ if (!c || !ISVISIBLE(c))
continue;
else
x += (1.0 / (double)m->bt) * m->btw;
- } while (ev->x > x && (c = c->next));
+ } while (c && ev->x > x && (c = c->next));
if (c) {
click = ClkWinTitle;