diff --git a/app/main.cpp b/app/main.cpp index 50c0e813..e9edb16e 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -388,7 +388,6 @@ int main(int argc, char *argv[]) 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."; qputenv("QT_QPA_PLATFORM", "eglfs"); - qputenv("SDL_VIDEODRIVER", "kmsdrm"); 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."; @@ -546,6 +545,14 @@ int main(int argc, char *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::ParseResult commandLineParserResult = parser.parse(app.arguments()); switch (commandLineParserResult) {