зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1297520 - For Snap, only install language for system locale. r=nalexander,OlivierTilloy
Differential Revision: https://phabricator.services.mozilla.com/D151052
This commit is contained in:
Родитель
f4fb6620ae
Коммит
0ce6d5df0f
|
@ -23,6 +23,9 @@
|
|||
#ifdef XP_WIN
|
||||
# include "WinUtils.h"
|
||||
#endif
|
||||
#ifdef MOZ_WIDGET_GTK
|
||||
# include "mozilla/WidgetUtilsGtk.h"
|
||||
#endif
|
||||
|
||||
#define INTL_SYSTEM_LOCALES_CHANGED "intl:system-locales-changed"
|
||||
|
||||
|
@ -69,6 +72,8 @@ static void ReadRequestedLocales(nsTArray<nsCString>& aRetVal) {
|
|||
const bool isRepack =
|
||||
#ifdef XP_WIN
|
||||
!mozilla::widget::WinUtils::HasPackageIdentity();
|
||||
#elif defined(MOZ_WIDGET_GTK)
|
||||
!widget::IsRunningUnderSnap();
|
||||
#else
|
||||
true;
|
||||
#endif
|
||||
|
|
|
@ -67,7 +67,7 @@ function simulateSnapEnvironment() {
|
|||
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||
Ci.nsIEnvironment
|
||||
);
|
||||
env.set("SNAP_NAME", AppConstants.MOZ_APP_NAME);
|
||||
env.set("SNAP_INSTANCE_NAME", AppConstants.MOZ_APP_NAME);
|
||||
|
||||
gIsLegacy = true;
|
||||
}
|
||||
|
|
|
@ -105,6 +105,8 @@ void SetLastMousePressEvent(GdkEvent* aEvent) {
|
|||
sLastMousePressEvent = event.release();
|
||||
}
|
||||
|
||||
bool IsRunningUnderSnap() { return g_getenv("SNAP_INSTANCE_NAME") != nullptr; }
|
||||
|
||||
bool IsRunningUnderFlatpak() {
|
||||
// https://gitlab.gnome.org/GNOME/gtk/-/blob/4300a5c609306ce77cbc8a3580c19201dccd8d13/gdk/gdk.c#L472
|
||||
static bool sRunning = [] {
|
||||
|
|
|
@ -39,7 +39,7 @@ GdkEvent* GetLastMousePressEvent();
|
|||
|
||||
// Return the snap's instance name, or null when not running as a snap.
|
||||
const char* GetSnapInstanceName();
|
||||
inline bool IsRunningUnderSnap() { return !!GetSnapInstanceName(); }
|
||||
bool IsRunningUnderSnap();
|
||||
bool IsRunningUnderFlatpak();
|
||||
inline bool IsRunningUnderFlatpakOrSnap() {
|
||||
return IsRunningUnderFlatpak() || IsRunningUnderSnap();
|
||||
|
|
Загрузка…
Ссылка в новой задаче