aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2018-08-23 14:00:01 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-03-04 12:39:53 +0000
commit1c7213dbc00fa595aeaa98ad5631bac56782599e (patch)
treea2821c20fccb994693c4bd41686fd22225bc53ae /src/quick/items
parent042f2b67739439c020451843d887d131d5f9cbdc (diff)
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 <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquickwindow.cpp1
1 files changed, 1 insertions, 0 deletions
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;