Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to detect if client is running in a Vmware to disable graphic acceleration #7687

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,24 @@ 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 = [&]() {
const auto systemEnvironment = QProcessEnvironment::systemEnvironment();
if (systemEnvironment.contains(QStringLiteral("VMWARE"))) {
return true;
}

if (systemEnvironment.contains("SESSIONNAME") && systemEnvironment.value("SESSIONNAME").startsWith("RDP-")) {
return true;
}

return false;
};

if (shouldDisableGraphicsAcceleration()) {
QProcessEnvironment::systemEnvironment().insert(QStringLiteral("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
Loading