summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmscreen.cpp
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2023-01-27 15:01:34 +0100
committerMikolaj Boc <mikolaj.boc@qt.io>2023-02-14 19:01:17 +0100
commitda5dc2062576b75b6427fcc2bc74dc4fcfd9dcf5 (patch)
tree40c662bbbf5e916f84e6e14acb86932359b9caa7 /src/plugins/platforms/wasm/qwasmscreen.cpp
parent22fc1d08bb666bb91470ad3759b91256a56ef4fa (diff)
Transfer touch event handling to QWasmWindow
Fixes: QTBUG-103498 Change-Id: Iec8b5cfba75131e7ddf855e6b729291950888fd3 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmscreen.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmscreen.cpp13
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()