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:
parent
6e12745c49
commit
b3d97da35f
3 changed files with 27 additions and 0 deletions
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue