From 78c1fcbc49f56463064eef738a475d9018357b24 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 1 Feb 2019 17:29:43 +0100 Subject: QQuickWindow: don't give exclusive grab to invisible or disabled Items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An Item might set itself invisible or disabled while handling a mouse press, as an alternative to rejecting the event. In earlier Qt versions (e.g. 5.6) it did not end up with a grab in such a case. Task-number: QTBUG-63271 Change-Id: I12f646e4217d773d396f380672420c85e6adcd52 Reviewed-by: Qt CI Bot Reviewed-by: Mitch Curtis Reviewed-by: Jan Arve Sæther --- src/quick/items/qquickwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick/items') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index dd5960e925..61c8bcc1e7 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2623,7 +2623,7 @@ void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo auto mouseGrabber = q->mouseGrabberItem(); if (mouseGrabber && mouseGrabber != item && mouseGrabber != oldMouseGrabber) { item->mouseUngrabEvent(); - } else { + } else if (item->isEnabled() && item->isVisible()) { item->grabMouse(); } point->setAccepted(true); -- cgit v1.2.3