diff --git a/launcher/config.kcfg b/launcher/config.kcfg
index dec7a86..27bc083 100644
--- a/launcher/config.kcfg
+++ b/launcher/config.kcfg
@@ -54,5 +54,8 @@ SPDX-License-Identifier: CC0-1.0
api.github.com
+
+ false
+
diff --git a/launcher/src/gamerunner.cpp b/launcher/src/gamerunner.cpp
index 8cd5213..8786fa4 100644
--- a/launcher/src/gamerunner.cpp
+++ b/launcher/src/gamerunner.cpp
@@ -13,6 +13,7 @@
#include "utility.h"
#include
+#include
using namespace Qt::StringLiterals;
@@ -340,6 +341,12 @@ void GameRunner::launchExecutable(const Profile &profile, QProcess *process, con
const QString logDir = dataDir.absoluteFilePath(QStringLiteral("log"));
env.insert(QStringLiteral("DXVK_LOG_PATH"), logDir);
+
+ // Enable the Wayland backend if we detect we're running on Wayland, otherwise fallback to X11.
+ if (QGuiApplication::platformName() == QStringLiteral("wayland") && m_launcher.config()->enableWayland()) {
+ // We have to unset the DISPLAY variable for Wine to pick it up.
+ env.remove(QStringLiteral("DISPLAY"));
+ }
#endif
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
diff --git a/launcher/ui/Settings/DeveloperSettings.qml b/launcher/ui/Settings/DeveloperSettings.qml
index 095fd8f..86a3cbb 100644
--- a/launcher/ui/Settings/DeveloperSettings.qml
+++ b/launcher/ui/Settings/DeveloperSettings.qml
@@ -85,6 +85,23 @@ FormCard.FormCardPage {
LauncherCore.config.save();
}
}
+
+ FormCard.FormDelegateSeparator {
+ above: renderDocCaptureDelegate
+ below: enableWaylandDelegate
+ }
+
+ FormCard.FormCheckDelegate {
+ id: enableWaylandDelegate
+
+ text: i18n("Run Game on Wayland")
+ description: i18n("Use the native Wine Wayland driver instead of going through XWayland.")
+ checked: LauncherCore.config.enableWayland
+ onCheckedChanged: {
+ LauncherCore.config.enableWayland = checked;
+ LauncherCore.config.save();
+ }
+ }
}
FormCard.FormHeader {