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.

Change-Id: I6a1aeaf0e6e0eb221d55de00c8f30259832e58fa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2e80e74f37980f62bb915983e61d6734fb416bcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9610a7cbdc9d3fe3df116edf9a251dd011ed4693)
This commit is contained in:
Tor Arne Vestbø 2024-12-16 16:09:48 +01:00 committed by Qt Cherry-pick Bot
parent e0e0854b05
commit 1c8b96491d

View File

@ -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()