Better fallback for current monitor removal

This commit is contained in:
Bastien Dejean 2013-06-09 21:33:20 +02:00
parent e3bc2b90bd
commit c0970551e5

View file

@ -86,7 +86,7 @@ void remove_monitor(monitor_t *m)
if (last_mon == m)
last_mon = NULL;
if (mon == m)
mon = (last_mon == NULL ? mon_head : last_mon);
mon = (last_mon == NULL ? (prev == NULL ? next : prev) : last_mon);
free(m);
num_monitors--;
put_status();