blob: af549c6664c1ef4d859874b358e5c26ba79372f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qwasmeventdispatcher.h"
#include "qwasmintegration.h"
#include <QtGui/qpa/qwindowsysteminterface.h>
QT_BEGIN_NAMESPACE
QWasmEventDispatcher::QWasmEventDispatcher(std::shared_ptr<QWasmSuspendResumeControl> suspendResume)
:QEventDispatcherWasm(suspendResume)
{
}
// Note: All event dispatcher functionality is implemented in QEventDispatcherWasm
// in QtCore, except for processPostedEvents() below which uses API from QtGui.
bool QWasmEventDispatcher::sendPostedEvents()
{
QEventDispatcherWasm::sendPostedEvents();
return QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::AllEvents);
}
void QWasmEventDispatcher::onLoaded()
{
// This function is called when the application is ready to paint
// the first frame. Send the qtlaoder onLoaded event first (via
// the base class implementation), and then enable/call requestUpdate
// to deliver a frame.
QEventDispatcherWasm::onLoaded();
// Make sure all screens have a defined size; and pick
// up size changes due to onLoaded event handling.
QWasmIntegration *wasmIntegration = QWasmIntegration::get();
wasmIntegration->resizeAllScreens();
wasmIntegration->releaseRequesetUpdateHold();
}
QT_END_NAMESPACE
|