diff options
author | DeepBlueV7.X <nicolas.werner@hotmail.de> | 2024-01-08 20:24:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 20:24:50 +0100 |
commit | ee727ba4229b01a5da92cac5abf2c574d11f98bc (patch) | |
tree | ca56f8b6d256a98ac0f1ce07acb9252a576bfcf2 | |
parent | fa53b5b5f3a8c570b21ed4fbcce6f0deb290ce93 (diff) | |
parent | 2ced20d755739c7e32a8f8e72a8ac186046b2b0f (diff) |
Merge pull request #1657 from q234rty/use-dynamic-properties
Use dynamic properties for NhekoFixupPaletteEventFilter
-rw-r--r-- | src/MainWindow.cpp | 6 | ||||
-rw-r--r-- | src/MainWindow.h | 3 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index a4a0eff0..9b2626cf 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -201,14 +201,12 @@ NhekoFixupPaletteEventFilter::eventFilter(QObject *obj, QEvent *event) // reason?!? if (event->type() == QEvent::ChildAdded && obj->metaObject()->className() == QStringLiteral("QQuickRootItem")) { - QSet<QWindow *> newWindows; for (const auto window : QGuiApplication::topLevelWindows()) { - newWindows.insert(window); - if (m_postedWindows.contains(window)) + if (window->property("posted").isValid()) continue; QGuiApplication::postEvent(window, new QEvent(QEvent::ApplicationPaletteChange)); + window->setProperty("posted", true); } - m_postedWindows.swap(newWindows); } return false; } diff --git a/src/MainWindow.h b/src/MainWindow.h index 928446aa..c493b5b2 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -45,9 +45,6 @@ public: } bool eventFilter(QObject *obj, QEvent *event) override; - -private: - QSet<QWindow *> m_postedWindows; }; class MainWindow : public QQuickView |