1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-05-13 21:07:46 +00:00

Add developer option to enable the Wine Wayland backend

The current situation is still (unfortunately...) rough, but it could be
useful to enable in some cases. Once it improves enough we can make
it the default.
This commit is contained in:
Joshua Goins 2025-05-07 22:44:57 -04:00
parent 6e12745c49
commit b3d97da35f
3 changed files with 27 additions and 0 deletions

View file

@ -54,5 +54,8 @@ SPDX-License-Identifier: CC0-1.0
<entry name="GithubApi" type="String">
<default>api.github.com</default>
</entry>
<entry name="EnableWayland" type="bool">
<default>false</default>
</entry>
</group>
</kcfg>

View file

@ -13,6 +13,7 @@
#include "utility.h"
#include <KProcessList>
#include <QGuiApplication>
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)

View file

@ -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 {