From 49b67b3e18d9b9b32bdfe8ff3c61b9acb3b93b17 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 2 Mar 2019 19:50:05 -0800 Subject: [PATCH] Adjust QGnomePlatform hack to avoid disabling desktop settings awareness. Fixes #185 --- app/main.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 59e783eb..0a0634c5 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -6,6 +6,7 @@ #include #include #include +#include // Don't let SDL hook our main function, since Qt is already // doing the same thing. This needs to be before any headers @@ -311,12 +312,20 @@ int main(int argc, char *argv[]) // Register custom metatypes for use in signals qRegisterMetaType("NvApp"); - // Disable desktop settings awareness due to issues with QGnomePlatform - // breaking our dialog rendering on Linux. - QGuiApplication::setDesktopSettingsAware(false); - QGuiApplication app(argc, argv); + // Override the default palette to fix dialog rendering on Linux + // with QGnomePlatform loaded. Using setDesktopSettingsAware(false) + // also works but can cause crashes in some configurations. + // + // See the following issues: + // https://github.com/moonlight-stream/moonlight-qt/issues/161 + // https://github.com/moonlight-stream/moonlight-qt/issues/185 + // https://github.com/FedoraQt/QGnomePlatform/issues/42 +#ifdef Q_OS_LINUX + app.setPalette(QPalette(Qt::lightGray)); +#endif + app.setWindowIcon(QIcon(":/res/moonlight.svg")); // Register our C++ types for QML