mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 13:44:17 +00:00
Adjust QGnomePlatform hack to avoid disabling desktop settings awareness. Fixes #185
This commit is contained in:
parent
bc97168dc7
commit
49b67b3e18
1 changed files with 13 additions and 4 deletions
17
app/main.cpp
17
app/main.cpp
|
@ -6,6 +6,7 @@
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
#include <QNetworkProxyFactory>
|
#include <QNetworkProxyFactory>
|
||||||
|
#include <QPalette>
|
||||||
|
|
||||||
// Don't let SDL hook our main function, since Qt is already
|
// Don't let SDL hook our main function, since Qt is already
|
||||||
// doing the same thing. This needs to be before any headers
|
// 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
|
// Register custom metatypes for use in signals
|
||||||
qRegisterMetaType<NvApp>("NvApp");
|
qRegisterMetaType<NvApp>("NvApp");
|
||||||
|
|
||||||
// Disable desktop settings awareness due to issues with QGnomePlatform
|
|
||||||
// breaking our dialog rendering on Linux.
|
|
||||||
QGuiApplication::setDesktopSettingsAware(false);
|
|
||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
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"));
|
app.setWindowIcon(QIcon(":/res/moonlight.svg"));
|
||||||
|
|
||||||
// Register our C++ types for QML
|
// Register our C++ types for QML
|
||||||
|
|
Loading…
Reference in a new issue