diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-12-04 10:35:14 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-12-04 10:35:14 (GMT) |
commit | 08de984f0ed5b6e13cd802256df859778f842bbd (patch) | |
tree | 916b1d67c9b5de9b3b4e37672dd376e6c9647c98 /src/gui/kernel | |
parent | 067cab5af9172335c07b48c42e6a665d5da9b54d (diff) | |
download | Qt-08de984f0ed5b6e13cd802256df859778f842bbd.zip Qt-08de984f0ed5b6e13cd802256df859778f842bbd.tar.gz Qt-08de984f0ed5b6e13cd802256df859778f842bbd.tar.bz2 |
Cocoa: amend dnd optimization: 067cab5af
A couple of minutes after commiting 067cab5af, I realized I need
to act a bit more nice to native NSViews that also might exist
in the window: Let NSWindow handle the dnd drop if the view is
not a QWidget (and not also if it is a QWidget, but not subscribing
to dnd)
Task-number: QT-1586
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index 8dd03aa..cc5839c 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -293,21 +293,27 @@ QT_END_NAMESPACE - (void)draggingExited:(id < NSDraggingInfo >)sender { - if (*currentDragTarget()) + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) + return [super draggingExited:sender]; + + if (*currentDragTarget()) { [reinterpret_cast<NSView *>((*currentDragTarget())->winId()) draggingExited:sender]; - else - [super draggingExited:sender]; - *currentDragTarget() = 0; + *currentDragTarget() = 0; + } } - (BOOL)performDragOperation:(id < NSDraggingInfo >)sender { - BOOL dropAccepted = NO; - if (*currentDragTarget()) - dropAccepted = [reinterpret_cast<NSView *>((*currentDragTarget())->winId()) performDragOperation:sender]; - else + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) return [super performDragOperation:sender]; - *currentDragTarget() = 0; - return dropAccepted; + + BOOL dropResult = NO; + if (*currentDragTarget()) { + dropResult = [reinterpret_cast<NSView *>((*currentDragTarget())->winId()) performDragOperation:sender]; + *currentDragTarget() = 0; + } + return dropResult; } |