From 5feb331c46db45f9fb74bd86a8ed3537c680e8ef Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 1 Dec 2025 00:36:59 -0600 Subject: [PATCH] Improve QT_QPA_EGLFS_KMS_CONFIG temporary file handling - Close it before handing it to the QPA plugin to read - Put the temporary file in TMPDIR instead of the current directory --- app/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index cfd1dfed..0bdb22d9 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -418,9 +418,9 @@ int main(int argc, char *argv[]) #endif // We keep this at function scope to ensure it stays around while we're running, - // becaue the Qt QPA will need to read it. Since the temporary file is only + // because the Qt QPA will need to read it. Since the temporary file is only // created when open() is called, this doesn't do any harm for other platforms. - QTemporaryFile eglfsConfigFile("eglfs_override_XXXXXX.conf"); + QTemporaryFile eglfsConfigFile; // Avoid using High DPI on EGLFS. It breaks font rendering. // https://bugreports.qt.io/browse/QTBUG-64377 @@ -463,6 +463,7 @@ int main(int argc, char *argv[]) qInfo() << "Overriding default Qt EGLFS card selection to" << cardOverride; QTextStream(&eglfsConfigFile) << "{ \"device\": \"" << cardOverride << "\" }"; qputenv("QT_QPA_EGLFS_KMS_CONFIG", eglfsConfigFile.fileName().toUtf8()); + eglfsConfigFile.close(); } } }