mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-21 23:25:09 +00:00
Fix SDL_VIDEODRIVER override when the Qt platform plugin was manually set
This commit is contained in:
parent
807fc6b31c
commit
12b93337d1
1 changed files with 8 additions and 1 deletions
|
@ -388,7 +388,6 @@ int main(int argc, char *argv[])
|
||||||
if (!qEnvironmentVariableIsSet("QT_QPA_PLATFORM")) {
|
if (!qEnvironmentVariableIsSet("QT_QPA_PLATFORM")) {
|
||||||
qInfo() << "Unable to detect Wayland or X11, so EGLFS will be used by default. Set QT_QPA_PLATFORM to override this.";
|
qInfo() << "Unable to detect Wayland or X11, so EGLFS will be used by default. Set QT_QPA_PLATFORM to override this.";
|
||||||
qputenv("QT_QPA_PLATFORM", "eglfs");
|
qputenv("QT_QPA_PLATFORM", "eglfs");
|
||||||
qputenv("SDL_VIDEODRIVER", "kmsdrm");
|
|
||||||
|
|
||||||
if (!qEnvironmentVariableIsSet("QT_QPA_EGLFS_ALWAYS_SET_MODE")) {
|
if (!qEnvironmentVariableIsSet("QT_QPA_EGLFS_ALWAYS_SET_MODE")) {
|
||||||
qInfo() << "Setting display mode by default. Set QT_QPA_EGLFS_ALWAYS_SET_MODE=0 to override this.";
|
qInfo() << "Setting display mode by default. Set QT_QPA_EGLFS_ALWAYS_SET_MODE=0 to override this.";
|
||||||
|
@ -546,6 +545,14 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
|
#ifndef STEAM_LINK
|
||||||
|
// Force use of the KMSDRM backend for SDL when using Qt platform plugins
|
||||||
|
// that directly draw to the display without a windowing system.
|
||||||
|
if (QGuiApplication::platformName() == "eglfs" || QGuiApplication::platformName() == "linuxfb") {
|
||||||
|
qputenv("SDL_VIDEODRIVER", "kmsdrm");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
GlobalCommandLineParser parser;
|
GlobalCommandLineParser parser;
|
||||||
GlobalCommandLineParser::ParseResult commandLineParserResult = parser.parse(app.arguments());
|
GlobalCommandLineParser::ParseResult commandLineParserResult = parser.parse(app.arguments());
|
||||||
switch (commandLineParserResult) {
|
switch (commandLineParserResult) {
|
||||||
|
|
Loading…
Reference in a new issue