From 2e80e74f37980f62bb915983e61d6734fb416bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 16 Dec 2024 16:09:48 +0100 Subject: [PATCH] QCocoaDrag: Only update m_lastView when it actually changes The underlying QObjCWeakPointer used to track the view requires a bit of bookkeeping, so avoid updating its value unless the view actually changes. Pick-to: 6.8 6.9 Change-Id: I6a1aeaf0e6e0eb221d55de00c8f30259832e58fa Reviewed-by: Volker Hilsheimer --- src/plugins/platforms/cocoa/qcocoadrag.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index 8e9fd053bda..64df903edcb 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -35,7 +35,8 @@ void QCocoaDrag::setLastInputEvent(NSEvent *event, NSView *view) { [m_lastEvent release]; m_lastEvent = [event copy]; - m_lastView = view; + if (view != m_lastView) + m_lastView = view; } QMimeData *QCocoaDrag::dragMimeData()