diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2023-04-26 11:33:09 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2023-05-11 10:13:43 +0200 |
commit | afcdf6cfad6db20668d22ecabca1f45d712e2383 (patch) | |
tree | 24d22f02395c38b542e0af3c7ff75053f2a7cdf2 /examples/quick/righttoleft | |
parent | 58961f035cac4b7b5331d4d8154889680b2ad4b9 (diff) |
QQuickFlickable: avoid processing the same event twice
If Flickable has an exclusive grab (e.g if it's being dragged), and
at the same time, a child has a passive grab (e.g a TapHandler inside
a child of the content item), Flickable ends up getting the same pointer
events twice.
The reason this happens is because Flickable has a childMouseEventFilter.
So the flickable will first get all the pointer events since it has an
exclusive grab, just to see that the filter will receive the same
events once more, as they next are delivered to the passive grabbers.
The result is that Flickable will handle all pointer events
(move, release etc) twice when it has en exclusive grab, which will
even cause the flickable from stop flicking prematurely if the mouse
release ends up outside the bounds of the flickable (because of a double
call to handleReleaseEvent(), which will set stealMouse to false too
early).
To fix this, this patch will make sure that we don't handle any pointer
events in the childMouseEventFilter if we already have an exclusive grab.
After all, having an exclusive grab means that we're already getting the
events the "normal" way, and shouldn't handle the same events once more.
Fixes: QTBUG-104987
Change-Id: Iaed49cb860cf50ea38a70a6e546d9dcf25cce444
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 1bac9de1136c8d52650199f9defefae2f1d6a1a5)
Diffstat (limited to 'examples/quick/righttoleft')
0 files changed, 0 insertions, 0 deletions