parent
ff804e3a74
commit
62001dc6cb
1 changed files with 8 additions and 6 deletions
|
@ -278,12 +278,6 @@ void ElectronBrowserMainParts::PostEarlyInitialization() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int ElectronBrowserMainParts::PreCreateThreads() {
|
int ElectronBrowserMainParts::PreCreateThreads() {
|
||||||
#if defined(USE_AURA)
|
|
||||||
if (!display::Screen::GetScreen()) {
|
|
||||||
screen_ = views::CreateDesktopScreen();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!views::LayoutProvider::Get())
|
if (!views::LayoutProvider::Get())
|
||||||
layout_provider_ = std::make_unique<views::LayoutProvider>();
|
layout_provider_ = std::make_unique<views::LayoutProvider>();
|
||||||
|
|
||||||
|
@ -314,6 +308,14 @@ int ElectronBrowserMainParts::PreCreateThreads() {
|
||||||
// Load resources bundle according to locale.
|
// Load resources bundle according to locale.
|
||||||
std::string loaded_locale = LoadResourceBundle(locale);
|
std::string loaded_locale = LoadResourceBundle(locale);
|
||||||
|
|
||||||
|
#if defined(USE_AURA)
|
||||||
|
// NB: must be called _after_ locale resource bundle is loaded,
|
||||||
|
// because ui lib makes use of it in X11
|
||||||
|
if (!display::Screen::GetScreen()) {
|
||||||
|
screen_ = views::CreateDesktopScreen();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Initialize the app locale.
|
// Initialize the app locale.
|
||||||
std::string app_locale = l10n_util::GetApplicationLocale(loaded_locale);
|
std::string app_locale = l10n_util::GetApplicationLocale(loaded_locale);
|
||||||
ElectronBrowserClient::SetApplicationLocale(app_locale);
|
ElectronBrowserClient::SetApplicationLocale(app_locale);
|
||||||
|
|
Loading…
Reference in a new issue