fix behaviour concerning min/max'ed windows

both when moving them from one monitor to another and when restoring them