Merge pull request #8286 from nextcloud/bugfix/disable-directwrite-before-1809

fix(gui): disable DirectWrite on Win10 versions before 1809
This commit is contained in:
Matthieu Gallien 2025-05-20 10:13:00 +02:00 committed by GitHub
commit 17011646fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,13 +76,18 @@ int main(int argc, char **argv)
#if defined Q_OS_MAC
qmlStyle = QStringLiteral("macOS");
#elif defined Q_OS_WIN
if (QOperatingSystemVersion::current().version() < QOperatingSystemVersion::Windows11.version()) {
if (const auto osVersion = QOperatingSystemVersion::current().version(); osVersion < QOperatingSystemVersion::Windows11.version()) {
qmlStyle = QStringLiteral("Universal");
widgetsStyle = QStringLiteral("Fusion");
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_UNIVERSAL_THEME")) {
// initialise theme with the light/dark mode setting from the OS
qputenv("QT_QUICK_CONTROLS_UNIVERSAL_THEME", "System");
}
if (osVersion < QOperatingSystemVersion::Windows10_1809.version() && qEnvironmentVariableIsEmpty("QT_QPA_PLATFORM")) {
// for Windows Server 2016 to display text as expected, see #8064
qputenv("QT_QPA_PLATFORM", "windows:nodirectwrite");
}
} else {
qmlStyle = QStringLiteral("FluentWinUI3");
widgetsStyle = QStringLiteral("windows11");