Fix MainPanel losing focus