I don't really know why but fixes when other window is rendering to take focus from the main one, but apparently if the main window is rendering can take focus from other windows