m->link.next leads to errors if the monitor to disable doesn't have a "next" (right) monitor and is currently focused. dirtmon() does more checks.
In some previous commits m->link.next is told to be left monitor, which is wrong
Also focusclient() explicitly checks for disabled monitors (this fixes in case of more than one disabled monitor)
L2ERA3TQPLMFAEQVNC5RFDTO532JQPHLYVBCE3JZT2J6VSXG4IJQC
if (!config_head->state.enabled) {
wl_list_for_each(m, &mons, link) {
if (m->wlr_output->name == wlr_output->name) {
// make sure that the monitor to clean is focused
selmon = m;
focusclient(selclient(), focustop(selmon), 1);
// focus the left monitor (relative to the current focus)
focusmon(&ar);
closemon(m, wl_container_of(&selmon->link, newmon, link));
}
}
}