summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-07-15 17:14:29 +0200
committerbakkeby <[email protected]>2020-07-15 17:14:29 +0200
commit06c4122e07155ef604bd767182247ee6877b2c94 (patch)
tree612232ba4d40561d653c47e8b71b677751a5aabd /patch
parente780c5078f1b344f3a9902fba1a7641e18931ca3 (diff)
downloaddwm-flexipatch-06c4122e07155ef604bd767182247ee6877b2c94.tar.gz
dwm-flexipatch-06c4122e07155ef604bd767182247ee6877b2c94.zip
Movestack can cause dwm to crash if there are no selections on the monitor
Diffstat (limited to 'patch')
-rw-r--r--patch/movestack.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/patch/movestack.c b/patch/movestack.c
index 2406a87..ab97b18 100644
--- a/patch/movestack.c
+++ b/patch/movestack.c
@@ -2,13 +2,13 @@ void
movestack(const Arg *arg)
{
Client *c = NULL, *p = NULL, *pc = NULL, *i;
-
if (arg->i > 0) {
+ if (!selmon->sel)
+ return;
/* find the client after selmon->sel */
for (c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
if (!c)
for (c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
-
}
else {
/* find the client before selmon->sel */
@@ -20,6 +20,7 @@ movestack(const Arg *arg)
if (ISVISIBLE(i) && !i->isfloating)
c = i;
}
+
/* find the client before selmon->sel and c */
for (i = selmon->clients; i && (!p || !pc); i = i->next) {
if (i->next == selmon->sel)