At least on Linux, fixes an annoying issue where closing the application
window causes it to disappear and reappear briefly before exiting.
Merge pull request #3886 from ey6es/master

At least on Linux, fixes an annoying issue where closing the application