From 1c7213dbc00fa595aeaa98ad5631bac56782599e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Thu, 23 Aug 2018 14:00:01 +0200 Subject: Fix a bug where hover events were not sent if the mouse was never moved This happened if the "real mouse" was never moved, since moving the real mouse caused it to update the internal QQuickWindowPrivate::lastMousePosition. If the window never got any mouse events, it would therefore fail to generate proper hover events. However, if the window got exposed under a mouse cursor it would generate a hover enter event. We therefore update lastMousePosition when that happens also. Change-Id: I77d9b1bd779a813756c4056b015f2e81664b6d36 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quick/items/qquickwindow.cpp') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 518970d1b7..fa9aa88faa 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1613,6 +1613,7 @@ bool QQuickWindow::event(QEvent *e) bool accepted = enter->isAccepted(); bool delivered = d->deliverHoverEvent(d->contentItem, enter->windowPos(), d->lastMousePosition, QGuiApplication::keyboardModifiers(), 0L, accepted); + d->lastMousePosition = enter->windowPos(); enter->setAccepted(accepted); d->updateCursor(mapFromGlobal(QCursor::pos())); return delivered; -- cgit v1.2.3