The window is closed when the tool becomes disabled. Improves #78731.