Fix freeze on Windows switching monitor

1 job for master in 18 minutes and 46 seconds