Prevent circular event handlers on Windows. #1856