diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2022-08-08 20:49:11 +0200 |
---|---|---|
committer | Morten Sørvig <morten.sorvig@qt.io> | 2022-08-17 04:52:46 +0200 |
commit | 238e90cd58433ec79e82325d06fb75d9038b9607 (patch) | |
tree | 837ab0ffb205767096eec02feb14c9adac912745 /src/corelib/kernel/qeventdispatcher_wasm.cpp | |
parent | fa0e24b641ad241195cab24d008fed6e68983944 (diff) |
wasm: remove dead qt_asyncify_yield() code
The call to this function was behind a broken #define and
was never enabled. It also does not work, so remove it.
This means that calling processEvents() in a loop (as opposed
to calling exec()) most likely does not work either, which
is something we want to revisit.
Pick-to: 6.4
Change-Id: I90802a69d3a48e7f2b5d0b657d89452c09d9571a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_wasm.cpp')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_wasm.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_wasm.cpp b/src/corelib/kernel/qeventdispatcher_wasm.cpp index c733f46c14..2363d5a79b 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm.cpp +++ b/src/corelib/kernel/qeventdispatcher_wasm.cpp @@ -76,17 +76,6 @@ bool qt_asyncify_resume() return true; } -// Yields control to the browser, so that it can process events. Must -// be called on the main thread. Returns false immediately if Qt has -// already suspended the main thread. Returns true after yielding. -bool qt_asyncify_yield() -{ - if (g_is_asyncify_suspended) - return false; - emscripten_sleep(0); - return true; -} - #endif // QT_HAVE_EMSCRIPTEN_ASYNCIFY Q_CONSTINIT QEventDispatcherWasm *QEventDispatcherWasm::g_mainThreadEventDispatcher = nullptr; @@ -198,9 +187,6 @@ bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags) handleApplicationExec(); } - if (!(flags & QEventLoop::ExcludeUserInputEvents)) - pollForNativeEvents(); - hasPendingEvents = qGlobalPostedEventsCount() > 0; if (!hasPendingEvents && (flags & QEventLoop::WaitForMoreEvents)) @@ -386,21 +372,6 @@ void QEventDispatcherWasm::handleDialogExec() // For the asyncify case we do nothing here and wait for events in wait() } -void QEventDispatcherWasm::pollForNativeEvents() -{ - // Secondary thread event dispatchers do not support native events - if (isSecondaryThreadEventDispatcher()) - return; - -#if HAVE_EMSCRIPTEN_ASYNCIFY - // Asyncify allows us to yield to the browser and have it process native events - - // but this will fail if we are recursing and are already in a yield. - bool didYield = qt_asyncify_yield(); - if (!didYield) - qWarning("QEventDispatcherWasm::processEvents() did not asyncify process native events"); -#endif -} - // Blocks/suspends the calling thread. This is possible in two cases: // - Caller is a secondary thread: block on m_moreEvents // - Caller is the main thread and asyncify is enabled: suspend using qt_asyncify_suspend() |