From 67b9baac52f7078af772f76b15743080282b48ef Mon Sep 17 00:00:00 2001 From: Stefan Wastl Date: Mon, 2 May 2022 15:21:41 +0200 Subject: [PATCH] macOS: Forward hover-events for embedded windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a QWindow is embedded into a native view it's effectively the root window, similar to a top level QWindow, and we need to forward hover events on behalf of itself and all child windows. Fixes: QTBUG-103084 Pick-to: 6.3 Change-Id: I1e94b9447fb561c1b02db87738de235c5d12b3a4 Reviewed-by: Tor Arne Vestbø Reviewed-by: --- src/plugins/platforms/cocoa/qnsview_mouse.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm index c0063f81a9..5f78a416b2 100644 --- a/src/plugins/platforms/cocoa/qnsview_mouse.mm +++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm @@ -607,8 +607,8 @@ static const QPointingDevice *pointingDeviceFor(qint64 deviceID) // in time (s_windowUnderMouse). The latter is also used to also send out enter/leave // events when the application is activated/deactivated. - // Top-level windows generate enter events for sub-windows. - if (!m_platformWindow->isContentView()) + // Root (top level or embedded) windows generate enter events for sub-windows + if (!m_platformWindow->isContentView() && !m_platformWindow->isEmbedded()) return; QPointF windowPoint; @@ -634,8 +634,8 @@ static const QPointingDevice *pointingDeviceFor(qint64 deviceID) if (!m_platformWindow) return; - // Top-level windows generate leave events for sub-windows. - if (!m_platformWindow->isContentView()) + // Root (top level or embedded) windows generate enter events for sub-windows + if (!m_platformWindow->isContentView() && !m_platformWindow->isEmbedded()) return; QCocoaWindow *windowToLeave = QCocoaWindow::s_windowUnderMouse;