Skip to content

Commit

Permalink
Merge pull request #7687 from nextcloud/bugfix/vmware
Browse files Browse the repository at this point in the history
Attempt to detect if client is running in a Vmware to disable graphic acceleration
  • Loading branch information
mgallien authored Feb 12, 2025
2 parents f56fff0 + 4544c2f commit 8fd3769
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8fd3769

Please sign in to comment.