Try not to point to an unlinked desktop

This commit is contained in:
Bastien Dejean 2013-06-06 00:29:50 +02:00
parent dde8f7f07b
commit 454c492a2f

View file

@ -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;
}