diff --git a/src/corelib/kernel/qeventdispatcher_wasm.cpp b/src/corelib/kernel/qeventdispatcher_wasm.cpp index 6818a5eab8c..3c38ac94eac 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm.cpp +++ b/src/corelib/kernel/qeventdispatcher_wasm.cpp @@ -212,13 +212,10 @@ bool QEventDispatcherWasm::isValidEventDispatcherPointer(QEventDispatcherWasm *e bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags) { + qCDebug(lcEventDispatcher) << "QEventDispatcherWasm::processEvents flags" << flags; + emit awake(); - bool hasPendingEvents = qGlobalPostedEventsCount() > 0; - - qCDebug(lcEventDispatcher) << "QEventDispatcherWasm::processEvents flags" << flags - << "pending events" << hasPendingEvents; - if (isMainThreadEventDispatcher()) { if (flags & QEventLoop::DialogExec) handleDialogExec(); @@ -226,23 +223,23 @@ bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags) handleApplicationExec(); } - if (!hasPendingEvents && (flags & QEventLoop::WaitForMoreEvents)) - wait(); + QCoreApplication::sendPostedEvents(); + processWindowSystemEvents(flags); if (m_interrupted) { m_interrupted = false; return false; } + if (flags & QEventLoop::WaitForMoreEvents) + wait(); + if (m_processTimers) { m_processTimers = false; processTimers(); } - QCoreApplication::sendPostedEvents(); - processWindowSystemEvents(flags); - - return qGlobalPostedEventsCount() > 0; + return false; } void QEventDispatcherWasm::processWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)