summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmcompositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmcompositor.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmcompositor.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp
index 66eaea62faa..48445d5db95 100644
--- a/src/plugins/platforms/wasm/qwasmcompositor.cpp
+++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp
@@ -4,6 +4,8 @@
#include "qwasmcompositor.h"
#include "qwasmwindow.h"
+#include <private/qeventdispatcher_wasm_p.h>
+
#include <qpa/qwindowsysteminterface.h>
#include <emscripten/html5.h>
@@ -41,6 +43,17 @@ void QWasmCompositor::setEnabled(bool enabled)
m_isEnabled = enabled;
}
+// requestUpdate delivery is initially disabled at startup, while Qt completes
+// startup tasks such as font loading. This function enables requestUpdate delivery
+// again.
+void QWasmCompositor::releaseRequesetUpdateHold()
+{
+ if (!m_requestUpdateHoldEnabled)
+ return;
+ m_requestUpdateHoldEnabled = false;
+ requestUpdate();
+}
+
void QWasmCompositor::requestUpdateWindow(QWasmWindow *window, UpdateRequestDeliveryType updateType)
{
auto it = m_requestUpdateWindows.find(window);
@@ -62,6 +75,9 @@ void QWasmCompositor::requestUpdate()
if (m_requestAnimationFrameId != -1)
return;
+ if (m_requestUpdateHoldEnabled)
+ return;
+
static auto frame = [](double frameTime, void *context) -> int {
Q_UNUSED(frameTime);