Bug 1522780 - [Wayland] Use MOZ_ENABLE_WAYLAND to enable wayland backend, r=glandium

Recently we use GDK_BACKEND to enable/disable Wayland backend. That's good for testing but bad for distro deployment.

When GDK_BACKEND is set it's propagated to child processes which may not support wayland thus they fail to run. Also when GDK_BACKEND=wayland is set Firefox fails to start when Wayland backend is not available.

To allow easy deployment let's use a specific MOZ_ENABLE_WAYLAND env which means to use a default available GTK backend (x11 or wayland) and don't fail when Wayland is missing.

Differential Revision: https://phabricator.services.mozilla.com/D17607

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Martin Stransky 2019-01-29 09:27:05 +00:00
Родитель c0ea718314
Коммит 7c1ff93ef0
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -3622,12 +3622,15 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
bool disableWayland = true;
# if defined(MOZ_WAYLAND)
// Make X11 backend the default one.
// Enable Wayland backend only when GDK_BACKEND is set and
// Gtk+ >= 3.22 where we can expect recent enough
// Enable Wayland on Gtk+ >= 3.22 where we can expect recent enough
// compositor & libwayland interface.
disableWayland = (PR_GetEnv("GDK_BACKEND") == nullptr) ||
(gtk_check_version(3, 22, 0) != nullptr);
disableWayland = (gtk_check_version(3, 22, 0) != nullptr);
if (!disableWayland) {
// Make X11 backend the default one unless MOZ_ENABLE_WAYLAND or
// GDK_BACKEND are specified.
disableWayland = (PR_GetEnv("GDK_BACKEND") == nullptr) &&
(PR_GetEnv("MOZ_ENABLE_WAYLAND") == nullptr);
}
# endif
// On Wayland disabled builds read X11 DISPLAY env exclusively
// and don't care about different displays.