Fix forcing X11 SDL video driver on XWayland when not built with Wayland
This commit is contained in:
parent
c33c49e6fa
commit
402ac59390
1 changed files with 12 additions and 11 deletions
23
app/main.cpp
23
app/main.cpp
|
|
@ -693,14 +693,6 @@ 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
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
// Register signal handlers to arbitrate between SDL and Qt.
|
||||
// NB: This has to be done after the QGuiApplication is constructed to
|
||||
|
|
@ -774,15 +766,24 @@ int main(int argc, char *argv[])
|
|||
|
||||
// After the QGuiApplication is created, the platform stuff will be initialized
|
||||
// and we can set the SDL video driver to match Qt.
|
||||
if (WMUtils::isRunningWayland() && QGuiApplication::platformName() == "xcb") {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Detected XWayland. This will probably break hardware decoding! Try running with QT_QPA_PLATFORM=wayland or switch to X11.");
|
||||
if (QGuiApplication::platformName() == "xcb") {
|
||||
if (WMUtils::isRunningWayland()) {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Detected XWayland. This will probably break hardware decoding! Try running with QT_QPA_PLATFORM=wayland or switch to X11.");
|
||||
}
|
||||
qputenv("SDL_VIDEODRIVER", "x11");
|
||||
}
|
||||
else if (QGuiApplication::platformName().startsWith("wayland")) {
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Detected Wayland");
|
||||
qputenv("SDL_VIDEODRIVER", "wayland");
|
||||
}
|
||||
#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.
|
||||
else if (QGuiApplication::platformName() == "eglfs" || QGuiApplication::platformName() == "linuxfb") {
|
||||
qputenv("SDL_VIDEODRIVER", "kmsdrm");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef STEAM_LINK
|
||||
// Qt 5.9 from the Steam Link SDK is not able to load any fonts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue