From ff516f63b49506d384f6fc7bfb78f5e79d846aba Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 3 Jan 2021 11:16:59 -0600 Subject: [PATCH] Set QT_QPA_EGLFS_ALWAYS_SET_MODE=1 by default for RetroPie compatibility --- app/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/main.cpp b/app/main.cpp index 83039251..cffd65d2 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -323,6 +323,13 @@ int main(int argc, char *argv[]) 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"); + 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."; + + // The UI doesn't appear on RetroPie without this option. + qputenv("QT_QPA_EGLFS_ALWAYS_SET_MODE", "1"); + } + if (!QFile("/dev/dri").exists()) { qWarning() << "Unable to find a KMSDRM display device!"; qWarning() << "On the Raspberry Pi, you must enable the 'fake KMS' driver in raspi-config to use Moonlight outside of the GUI environment.";