The current system only measures the window's center and determines whether it is inside the bounds of the list of monitors. This causes issues if the window has been moved outside of the bounds of any monitor, and should fall back to either the closest monitor, or the last-used monitor.
Will require a bit of reworking for performance.