diff --git a/src/languagectrl.cpp b/src/languagectrl.cpp index c76a3d1917..3249d385c8 100644 --- a/src/languagectrl.cpp +++ b/src/languagectrl.cpp @@ -41,8 +41,12 @@ void LanguageCtrl::Init(Language lang) { SetHint(_("Language Code or Name (e.g. en_GB)")); + // wxGTK must have the value set before autocompletion to avoid annoying + // popups in some (hard to determine) cases. +#ifdef __WXGTK__ if (lang.IsValid()) SetValue(lang.FormatForRoundtrip()); +#endif #ifdef __WXOSX__ for (auto x: Language::AllFormattedNames()) @@ -61,6 +65,12 @@ void LanguageCtrl::Init(Language lang) #endif m_inited = true; + + // ...but wxMSW requires the opposite, otherwise the text wouldn't appear. +#ifndef __WXGTK__ + if (lang.IsValid()) + SetValue(lang.FormatForRoundtrip()); +#endif } void LanguageCtrl::SetLang(const Language& lang)