Fix event() chaining in QWinEventNotifier

We should return the result of the call of the base implementation for
all events that we did not handle. Also, QObject::event() does not
actually activate any filters, so the comment was inaccurate as well.

Change-Id: I9eb2f9a93a6b53a1afd035433615bcc0ee8cbf2c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
Alex Trotsenko 2020-11-18 18:35:27 +02:00 committed by Oswald Buddenhagen
parent 6f694b7fe1
commit 9a161b6700

View File

@ -211,15 +211,16 @@ void QWinEventNotifier::setEnabled(bool enable)
bool QWinEventNotifier::event(QEvent * e)
{
Q_D(QWinEventNotifier);
if (e->type() == QEvent::ThreadChange) {
switch (e->type()) {
case QEvent::ThreadChange:
if (d->enabled) {
QMetaObject::invokeMethod(this, "setEnabled", Qt::QueuedConnection,
Q_ARG(bool, true));
setEnabled(false);
}
}
QObject::event(e); // will activate filters
if (e->type() == QEvent::WinEventAct) {
break;
case QEvent::WinEventAct:
// Emit notification, but only if the event has not been invalidated
// since by the notifier being disabled, even if it was re-enabled
// again.
@ -233,8 +234,10 @@ bool QWinEventNotifier::event(QEvent * e)
d->registerWaitObject();
}
return true;
default:
break;
}
return false;
return QObject::event(e);
}
void CALLBACK QWinEventNotifierPrivate::wfsoCallback(void *context, BOOLEAN /*ignore*/)