macOS: Forward hover-events for embedded windows

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ø <tor.arne.vestbo@qt.io>
Reviewed-by: <stefan.wastl@native-instruments.de>
This commit is contained in:
Stefan Wastl 2022-05-02 15:21:41 +02:00 committed by Tor Arne Vestbø
parent a783c3d574
commit 67b9baac52

View File

@ -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;