diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 080ad34e63af0..6c00e6b6d745d 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -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