Skip to content

Commit 5feb331

Browse files
committed
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
1 parent 9d5f25f commit 5feb331

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ int main(int argc, char *argv[])
418418
#endif
419419

420420
// We keep this at function scope to ensure it stays around while we're running,
421-
// becaue the Qt QPA will need to read it. Since the temporary file is only
421+
// because the Qt QPA will need to read it. Since the temporary file is only
422422
// created when open() is called, this doesn't do any harm for other platforms.
423-
QTemporaryFile eglfsConfigFile("eglfs_override_XXXXXX.conf");
423+
QTemporaryFile eglfsConfigFile;
424424

425425
// Avoid using High DPI on EGLFS. It breaks font rendering.
426426
// https://bugreports.qt.io/browse/QTBUG-64377
@@ -463,6 +463,7 @@ int main(int argc, char *argv[])
463463
qInfo() << "Overriding default Qt EGLFS card selection to" << cardOverride;
464464
QTextStream(&eglfsConfigFile) << "{ \"device\": \"" << cardOverride << "\" }";
465465
qputenv("QT_QPA_EGLFS_KMS_CONFIG", eglfsConfigFile.fileName().toUtf8());
466+
eglfsConfigFile.close();
466467
}
467468
}
468469
}

0 commit comments

Comments
 (0)