Merge pull request #7687 from nextcloud/bugfix/vmware

Attempt to detect if client is running in a Vmware to disable graphic acceleration
This commit is contained in:
Matthieu Gallien 2025-02-12 09:54:48 +01:00 committed by GitHub
commit 8fd376992d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -232,6 +232,23 @@ Application::Application(int &argc, char **argv)
// Ensure OpenSSL config file is only loaded from app directory
QString opensslConf = QCoreApplication::applicationDirPath() + QStringLiteral("/openssl.cnf");
qputenv("OPENSSL_CONF", opensslConf.toLocal8Bit());
const auto shouldDisableGraphicsAcceleration = [&]() {
if (qEnvironmentVariableIsSet("VMWARE")) {
return true;
}
if (qEnvironmentVariableIsSet("SESSIONNAME") && qEnvironmentVariable("SESSIONNAME").startsWith("RDP-")) {
return true;
}
return false;
};
if (shouldDisableGraphicsAcceleration()) {
qputenv("SVGA_ALLOW_LLVMPIPE", 0);
qCInfo(lcApplication) << "Disabling graphics acceleration, application might be running in a virtual or in a remote desktop.";
}
#endif
// TODO: Can't set this without breaking current config paths