5c3efe8
diff -up firefox-65.0/toolkit/xre/nsAppRunner.cpp.1522780 firefox-65.0/toolkit/xre/nsAppRunner.cpp
5c3efe8
--- firefox-65.0/toolkit/xre/nsAppRunner.cpp.1522780	2019-02-04 14:27:16.704591496 +0100
5c3efe8
+++ firefox-65.0/toolkit/xre/nsAppRunner.cpp	2019-02-04 14:30:01.869913509 +0100
5c3efe8
@@ -3839,12 +3839,14 @@ int XREMain::XRE_mainStartup(bool* aExit
a502048
 
a502048
     bool disableWayland = true;
5c3efe8
 #if defined(MOZ_WAYLAND)
a502048
-    // Make X11 backend the default one.
a502048
-    // Enable Wayland backend only when GDK_BACKEND is set and
a502048
-    // Gtk+ >= 3.22 where we can expect recent enough
5c3efe8
-    // compositor & libwayland interface.
a502048
-    disableWayland = (PR_GetEnv("GDK_BACKEND") == nullptr) ||
a502048
-                     (gtk_check_version(3, 22, 0) != nullptr);
5c3efe8
+    // Enable Wayland on Gtk+ >= 3.22 where we can expect recent enough
a502048
+    disableWayland = (gtk_check_version(3, 22, 0) != nullptr);
a502048
+    if (!disableWayland) {
a502048
+      // Make X11 backend the default one unless MOZ_ENABLE_WAYLAND or
a502048
+      // GDK_BACKEND are specified.
a502048
+      disableWayland = (PR_GetEnv("GDK_BACKEND") == nullptr) &&
a502048
+                       (PR_GetEnv("MOZ_ENABLE_WAYLAND") == nullptr);
a502048
+    }
5c3efe8
 #endif
a502048
     // On Wayland disabled builds read X11 DISPLAY env exclusively
a502048
     // and don't care about different displays.