diff options
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmscreen.cpp')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmscreen.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/platforms/wasm/qwasmscreen.cpp b/src/plugins/platforms/wasm/qwasmscreen.cpp index 67449b65784..6f8d1509ab8 100644 --- a/src/plugins/platforms/wasm/qwasmscreen.cpp +++ b/src/plugins/platforms/wasm/qwasmscreen.cpp @@ -71,12 +71,17 @@ QWasmScreen::QWasmScreen(const emscripten::val &containerOrCanvas) emscripten::val::module_property("specialHTMLTargets") .set(outerScreenId().toStdString(), m_container); - // Install event handlers on the container/canvas. This must be - // done after the canvas has been created above. - m_compositor->initEventHandlers(); - updateQScreenAndCanvasRenderSize(); m_shadowContainer.call<void>("focus"); + + m_touchDevice = std::make_unique<QPointingDevice>( + "touchscreen", 1, QInputDevice::DeviceType::TouchScreen, + QPointingDevice::PointerType::Finger, + QPointingDevice::Capability::Position | QPointingDevice::Capability::Area + | QPointingDevice::Capability::NormalizedPosition, + 10, 0); + + QWindowSystemInterface::registerInputDevice(m_touchDevice.get()); } QWasmScreen::~QWasmScreen() |