]> git.lizzy.rs Git - bspwm.git/commitdiff
Try not to point to an unlinked desktop
authorBastien Dejean <nihilhill@gmail.com>
Wed, 5 Jun 2013 22:29:50 +0000 (00:29 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Wed, 5 Jun 2013 22:29:50 +0000 (00:29 +0200)
types.c

diff --git a/types.c b/types.c
index 202619389d7d01248bda352fa67a57a929d0f76b..f3c8eb70f989c6ebd4c28543890d909474a6b140 100644 (file)
--- a/types.c
+++ b/types.c
@@ -173,7 +173,7 @@ void unlink_desktop(monitor_t *m, desktop_t *d)
     if (m->last_desk == d)
         m->last_desk = NULL;
     if (m->desk == d)
-        m->desk = (m->last_desk == NULL ? m->desk_head : m->last_desk);
+        m->desk = (m->last_desk == NULL ? (prev == NULL ? next : prev) : m->last_desk);
     d->prev = d->next = NULL;
 }