Fix DockWidget::windowActiveAboutToChange() being emitted too much

Was being emitted even when it didn't affect our window.
This caused an explosion of signals when we had many dock widgets.
This commit is contained in:
Sergio Martins
2020-11-17 18:52:15 +00:00
parent d92d7c258c
commit 1393ae224f

View File

@@ -601,7 +601,7 @@ bool DockWidgetBase::eventFilter(QObject *watched, QEvent *event)
{
const bool isWindowActivate = event->type() == QEvent::WindowActivate;
const bool isWindowDeactivate = event->type() == QEvent::WindowDeactivate;
if (isWindowActivate || isWindowDeactivate)
if ((isWindowActivate || isWindowDeactivate) && watched == window())
Q_EMIT windowActiveAboutToChange(isWindowActivate);
return QWidgetAdapter::eventFilter(watched, event);