summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventdispatcher_wasm_p.h
Commit message (Collapse)AuthorAgeFilesLines
* wasm: implement socket notifier supportMorten Johan Sørvig2022-01-171-0/+10
| | | | | | | | | | | | | Implement socket notifier support using Emscripten’s socket callbacks. This is sufficient for supporting non-blocking (tunneled) TCP and UDP sockets on the main thread. Change-Id: Ib9ee2698d029fb94d954c6872f8e118b0aa15499 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> (cherry picked from commit 44d2f97bff647d3e3c0064ad97cf82cb5d3b47b3)
* wasm: add virtual processWindowSystemEvents()Morten Johan Sørvig2021-12-231-0/+3
| | | | | | | | | | | The QtCore event dispatcher will be used from QtGui as well. Add virtual function where window system events processing can be added. Change-Id: Ia6eda9ae18b2e91189ef9f60b6621d19a83313de Reviewed-by: Lorn Potter <lorn.potter@gmail.com> (cherry picked from commit e98f5de6e1a19e06cc9e94ea01ca27d9a65f8d70) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: enable event dispatcher asyncify supportMorten Johan Sørvig2021-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Misc. fixes, including: Fix a couple of typos in the JavaScript code. Also, macros- within-macros don’t work, (without resorting to preprocessor token pasting), so remove the debug output for now. Limit the exec() “simulateInfiniteLoop” workaround to top-level application exec() only. This way, asyncify can be used for nested QEventLoop::exec() calls. (Emscripten supports one level of suspend only, so we don’t want to use that for the top-level exec(), but instead use it for dialogs and such). Use the new QEventLoop::ProcessEventsFlag::ApplicationExec enum value to detect the exec() call type. Change-Id: Ic702bfc31faf2e9f84ac5d3ccf43d067c5c61bf0 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* QEventDispatcherWasm: handle EventLoopExecMorten Johan Sørvig2021-09-151-0/+1
| | | | | | | | | Call emscripten_set_main_loop like the old GUI event dispatcher did, with one difference that requestAnimationFrame updates are now no longer handled by the event dispatcher. Change-Id: If02d90ae9c45d7b38999567d733a237af842cded Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: add DialogExec hack/warning to event dispatcherMorten Johan Sørvig2021-09-081-0/+1
| | | | | | | | Show the warning (and call emscripten_sleep) for the standard build, but not for the asyncify build. Change-Id: I695a580ea60897872beee6fa2b6ae70acb9e7dcf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: add new event dispatcher implementationMorten Johan Sørvig2021-08-271-0/+125
Add QEventDispatcherWasm to QtCore. The event dispatcher supports managing event queue wakeups and timers, both for the main thread or for secondary threads. Blocking in processEvents() (using QEventLoop::WaitForMoreEvents) is supported when running on a secondary thread, or on the main thread when Qt is built with Emscripten’s asyncify support. Code is shared for all both modes as far as possible, with breakout functions which handle main and secondary thread as well as asyncify specifics,. Some functions like wakeUp() can be called from any thread, and needs to take the calling thread into consideration as well. The current asyncify implementation in Emscripten is restricted to one level of suspend, and this restriction carries over to Qt as well. In practice this means we support one level of exec()-like API. Note that this commit does not _enable_ use of the new event dispatcher. This will be done in separate commits. Task-number: QTBUG-76007 Task-number: QTBUG-64020 Change-Id: I77dc9ba34bcff59ef05dd23a46dbf1873cbe6780 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>