diff --git a/src/corelib/kernel/qeventdispatcher_wasm.cpp b/src/corelib/kernel/qeventdispatcher_wasm.cpp index 7632b2ca55..f5c2802aa6 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm.cpp +++ b/src/corelib/kernel/qeventdispatcher_wasm.cpp @@ -206,10 +206,12 @@ bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags) qCDebug(lcEventDispatcher) << "QEventDispatcherWasm::processEvents flags" << flags << "pending events" << hasPendingEvents; - if (flags & QEventLoop::DialogExec) - handleDialogExec(); - else if (flags & QEventLoop::EventLoopExec) - handleEventLoopExec(); + if (isMainThreadEventDispatcher()) { + if (flags & QEventLoop::DialogExec) + handleDialogExec(); + else if (flags & QEventLoop::EventLoopExec) + handleEventLoopExec(); + } if (!(flags & QEventLoop::ExcludeUserInputEvents)) pollForNativeEvents();