aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-05-14 10:50:49 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-05-14 21:45:08 +0000
commit771c17b40d8af88860c88f97d9f88595b309d01f (patch)
tree4bfa4c11d70480a2cf71f6a92fa8db75c8008849
parentf29eb56e770c3a4723a19304738557d4cac26886 (diff)
Enhance approveGrabTransition log message
Show the existing grabber, not only the proposed grabber. Change-Id: Idd1b41f96b063793c3c97aa67aa4425e2d58a027 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 2ae029e00bf4a0403aaeb24cbdcdfb0881b855e6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quick/handlers/qquickpointerhandler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp
index 9eab3c86f8..92788fa0d7 100644
--- a/src/quick/handlers/qquickpointerhandler.cpp
+++ b/src/quick/handlers/qquickpointerhandler.cpp
@@ -339,8 +339,8 @@ bool QQuickPointerHandler::approveGrabTransition(QPointerEvent *event, const QEv
{
Q_D(const QQuickPointerHandler);
bool allowed = false;
+ QObject* existingGrabber = event->exclusiveGrabber(point);
if (proposedGrabber == this) {
- QObject* existingGrabber = event->exclusiveGrabber(point);
allowed = (existingGrabber == nullptr) || ((d->grabPermissions & CanTakeOverFromAnything) == CanTakeOverFromAnything);
if (existingGrabber) {
if (QQuickPointerHandler *existingPhGrabber = qobject_cast<QQuickPointerHandler *>(event->exclusiveGrabber(point))) {
@@ -395,7 +395,8 @@ bool QQuickPointerHandler::approveGrabTransition(QPointerEvent *event, const QEv
}
qCDebug(lcPointerHandlerGrab) << "point" << Qt::hex << point.id() << "permission" <<
QMetaEnum::fromType<GrabPermissions>().valueToKeys(grabPermissions()) <<
- ':' << this << (allowed ? "approved to" : "denied to") << proposedGrabber;
+ ':' << this << (allowed ? "approved from" : "denied from") <<
+ existingGrabber << "to" << proposedGrabber;
return allowed;
}