Prevent use of wayland theme on Linux

* Wayland theme is buggy yet enforced by default
on Qt 5.11+ on Gnome desktop environment
* Resolves #2006
This commit is contained in:
Jonathan White 2019-01-21 18:09:47 -05:00
parent 7e1b16250c
commit f446774605

View File

@ -51,6 +51,13 @@ int main(int argc, char** argv)
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#ifdef Q_OS_LINUX
if (qgetenv("XDG_SESSION_TYPE") == QByteArrayLiteral("wayland")) {
qWarning() << "Warning: disregarding XDG_SESSION_TYPE=wayland";
qWarning() << "To use wayland anyway, please set QT_QPA_PLATFORM=wayland";
qunsetenv("XDG_SESSION_TYPE");
}
#endif
Application app(argc, argv);
Application::setApplicationName("keepassxc");