wasm: capture pointer unconditionally on PointerDown event
The pointer events weren't captured previously if, for example, mouse was pressed inside the window and released outside of the window. Pick-to: 6.4 Fixes: QTBUG-71948 Change-Id: Ie50e5c132fa03046f0c5b321c35a58cb9f34b67a Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
81d9b5ada4
commit
aee64bbe13
@ -606,6 +606,8 @@ bool QWasmCompositor::processPointer(const PointerEvent& event)
|
||||
switch (event.type) {
|
||||
case EventType::PointerDown:
|
||||
{
|
||||
screen()->canvas().call<void>("setPointerCapture", event.pointerId);
|
||||
|
||||
if (targetWindow)
|
||||
targetWindow->requestActivate();
|
||||
|
||||
@ -619,6 +621,8 @@ bool QWasmCompositor::processPointer(const PointerEvent& event)
|
||||
}
|
||||
case EventType::PointerUp:
|
||||
{
|
||||
screen()->canvas().call<void>("releasePointerCapture", event.pointerId);
|
||||
|
||||
m_windowManipulation.onPointerUp(event);
|
||||
|
||||
if (m_pressedWindow) {
|
||||
@ -779,8 +783,6 @@ void QWasmCompositor::WindowManipulation::onPointerDown(
|
||||
.window = windowAtPoint,
|
||||
.operationSpecific = std::move(*operationSpecific),
|
||||
});
|
||||
|
||||
m_screen->canvas().call<void>("setPointerCapture", event.pointerId);
|
||||
}
|
||||
|
||||
void QWasmCompositor::WindowManipulation::onPointerMove(
|
||||
@ -818,7 +820,6 @@ void QWasmCompositor::WindowManipulation::onPointerUp(const PointerEvent& event)
|
||||
return;
|
||||
|
||||
m_state.reset();
|
||||
m_screen->canvas().call<void>("releasePointerCapture", event.pointerId);
|
||||
}
|
||||
|
||||
bool QWasmCompositor::processKeyboard(int eventType, const EmscriptenKeyboardEvent *emKeyEvent)
|
||||
|
Loading…
x
Reference in New Issue
Block a user