Fix main window deactivated opening first file in Windows.