diff options
author | Mikolaj Boc <[email protected]> | 2023-03-08 10:18:04 +0100 |
---|---|---|
committer | Lorn Potter <[email protected]> | 2023-09-20 10:30:30 +0000 |
commit | 110286341a0a745aa505a10cd39eb56148e53d9f (patch) | |
tree | 8e1f319655967fb36223ecf6342c048b9e8c9d32 | |
parent | e9b0dbe05be9c0afd7c9e32bb6ab9ff81b7b3c2f (diff) |
Stop propagation and default action on WASM window pointer event
The windows should not let events through to targets below (unless
they are Qt::WindowTransparentForInput, which is handled
independently). Therefore, stopPropagation and preventDefault are
now called regardless of whether the window has handled the event
or not. If the event is not handled explicitly, we still consume the
DOM event so that the windows/elements below don't get focus by
mistake.
Fixes: QTBUG-116557
Change-Id: Idc78ac5076e97992d9f6f13a1fa574d0df4178ac
Pick-to: 6.5.3
Reviewed-by: Morten Johan Sørvig <[email protected]>
-rw-r--r-- | src/plugins/platforms/wasm/qwasmwindowclientarea.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindowclientarea.cpp b/src/plugins/platforms/wasm/qwasmwindowclientarea.cpp index 83b7dbd5304..a0684e8ecf8 100644 --- a/src/plugins/platforms/wasm/qwasmwindowclientarea.cpp +++ b/src/plugins/platforms/wasm/qwasmwindowclientarea.cpp @@ -19,8 +19,9 @@ ClientArea::ClientArea(QWasmWindow *window, QWasmScreen *screen, emscripten::val : m_screen(screen), m_window(window), m_element(element) { const auto callback = std::function([this](emscripten::val event) { - if (processPointer(*PointerEvent::fromWeb(event))) - event.call<void>("preventDefault"); + processPointer(*PointerEvent::fromWeb(event)); + event.call<void>("preventDefault"); + event.call<void>("stopPropagation"); }); m_pointerDownCallback = |