Disable GUI events after for File->Close. Closes #955.