diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-11-17 09:09:40 +0100 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-11-17 12:52:12 +0100 |
commit | 15b528dec376186410b4b30535f3cfc85f5932b2 (patch) | |
tree | 4d63fc58abcaea972ea874b6759d5b9d0b31fdf7 /src/plugins | |
parent | ac0cf6a5cc1a3c4c0d785c351c6389afa464e3c9 (diff) |
Null-check for window when handling pointer events
There might not be a window at the pointer event position on a WASM
screen, especially when the main window is not fullscreen.
Change-Id: I29aac8c410fdf2bf97cd1ed12433d87e18b4a354
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmcompositor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp index fe310618ce..b4d09da22f 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.cpp +++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp @@ -586,8 +586,9 @@ bool QWasmCompositor::processPointer(const PointerEvent& event) return targetWindow ? targetWindow : m_lastMouseTargetWindow.get(); })(); - if (targetWindow) - m_lastMouseTargetWindow = targetWindow; + if (!targetWindow) + return false; + m_lastMouseTargetWindow = targetWindow; const QPoint pointInTargetWindowCoords = targetWindow->mapFromGlobal(event.point); const bool pointerIsWithinTargetWindowBounds = targetWindow->geometry().contains(event.point); |