From a8901fde6777891f66bc188887228cbc985340a7 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Fri, 22 Nov 2024 17:55:45 -0800 Subject: [PATCH] debug/lint: run lints on reload for visible windows --- src/window/proxywindow.cpp | 9 ++++++--- src/window/proxywindow.hpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/window/proxywindow.cpp b/src/window/proxywindow.cpp index f3a2e6c1..ee5841b6 100644 --- a/src/window/proxywindow.cpp +++ b/src/window/proxywindow.cpp @@ -76,7 +76,10 @@ void ProxyWindowBase::onReload(QObject* oldInstance) { emit this->windowConnected(); this->postCompleteWindow(); - if (wasVisible && this->isVisibleDirect()) emit this->backerVisibilityChanged(); + if (wasVisible && this->isVisibleDirect()) { + emit this->backerVisibilityChanged(); + this->runLints(); + } } void ProxyWindowBase::postCompleteWindow() { this->setVisible(this->mVisible); } @@ -137,7 +140,7 @@ void ProxyWindowBase::connectWindow() { QObject::connect(this->window, &QWindow::heightChanged, this, &ProxyWindowBase::heightChanged); QObject::connect(this->window, &QWindow::screenChanged, this, &ProxyWindowBase::screenChanged); QObject::connect(this->window, &QQuickWindow::colorChanged, this, &ProxyWindowBase::colorChanged); - QObject::connect(this->window, &ProxiedWindow::exposed, this, &ProxyWindowBase::onWindowExposeEvent); + QObject::connect(this->window, &ProxiedWindow::exposed, this, &ProxyWindowBase::runLints); // clang-format on } @@ -221,7 +224,7 @@ void ProxyWindowBase::polishItems() { QQuickWindowPrivate::get(this->window)->polishItems(); } -void ProxyWindowBase::onWindowExposeEvent() { +void ProxyWindowBase::runLints() { if (!this->ranLints) { qs::debug::lintItemTree(this->mContentItem); this->ranLints = true; diff --git a/src/window/proxywindow.hpp b/src/window/proxywindow.hpp index 769dad03..8fa300a6 100644 --- a/src/window/proxywindow.hpp +++ b/src/window/proxywindow.hpp @@ -122,7 +122,7 @@ protected slots: void onMaskChanged(); void onMaskDestroyed(); void onScreenDestroyed(); - void onWindowExposeEvent(); + void runLints(); protected: bool mVisible = true;