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