Skip to content

Commit

Permalink
Detect if it is running in a Vmware or being access via RDP to disabl…
Browse files Browse the repository at this point in the history
…e graphic acceleration.

There has been reports of the client crashing in a VMware or being accessed via RDP
starting with 3.15.0 due to the client's use of graphic acceleration.

Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Feb 5, 2025
1 parent fd1e139 commit c561679
Showing 1 changed file with 18 additions and 0 deletions.
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

0 comments on commit c561679

Please sign in to comment.