Avoid freezing on Ubuntu when we select a file.