From 15b528dec376186410b4b30535f3cfc85f5932b2 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Thu, 17 Nov 2022 09:09:40 +0100 Subject: Null-check for window when handling pointer events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/plugins/platforms/wasm/qwasmcompositor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins') 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); -- cgit v1.2.3