Floating widndows with "x < removed monitor's width" aren't resized (they used to disappear in negative coordinates).
Actually delete monitors when they are unplugged, recalculate sgeom and give a new monitor to clients that were on the removed one with setmon()
arrangefloat() funcion has been exploded to save iterations in cleanupmon().
Also if a monitor that supports auto suspension is turned off, dwl will count it as unplugged (it will become unreachable and all clients will be moved to the leftmost monitor). However, if at least one monitor isn't plugged in, dwl will still crash the same as before.
Unlike sway, when the output configuration is changed and restored, (unplug + plug the same monitor for example) previous application positions aren't kept. This is due to the fact that on sway every workspace is unique among all monitors.
XXOC2AY53ZWML6TVPKX6BHGKZJNRET4IWRSTCVMJQJZMK3MFD3TQC
RJ533ETG67DQKGRTX2A6N2MFI76GTSU3KFGFAZGCVD33TT3SC67AC
7L3TU7JVWPBPHN7WF4TJ263BZ6BC3AYRRW6PULFUP5JZUGWWNUSAC
7B74AT3BXYB7PVW4F6SGQNPMHOU5TEV5TZ54CG6VSQI46XSEKWXQC
IH7QAHDQUTGT7KS2IP7SLDHYDEDX4BCQ4KDRYKIGV5Y477X3ZABQC
7HUMD4TAMWWBQDOZYCMWQXR66G3IU5WU3IVKTPCSMETSB6VREWTAC
3C2GQZEGV3UP22LMLNH4RBI5MXXTV447DBIOVMBPE7T6QZKINYXQC
IWSIO23DR44ZS2MBV66XNR2MIDID2KUNBRUTCEQRE4P5OMVZHSNAC
PLJJLNS7E2UXW2YARGBSV6IHZEBGL5EW354IMMHPDATY5DQD77DAC
arrangefloat(m, -1);
wl_list_for_each(newmon, &mons, link) {
wl_list_for_each(c, &clients, link) {
if (c->isfloating && c->geom.x > m->m.width) {
resize(c, c->geom.x - m->w.width, c->geom.y,
c->geom.width, c->geom.height, 0);
}
if (c->mon == m)
setmon(c, newmon, 0);
}
break;
}
free(m);