summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-12-04 11:35:14 +0100
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-12-04 11:35:14 +0100
commit08de984f0ed5b6e13cd802256df859778f842bbd (patch)
tree916b1d67c9b5de9b3b4e37672dd376e6c9647c98 /src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
parent067cab5af9172335c07b48c42e6a665d5da9b54d (diff)
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/qcocoasharedwindowmethods_mac_p.h')
-rw-r--r--src/gui/kernel/qcocoasharedwindowmethods_mac_p.h26
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 8dd03aaad5..cc5839c550 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;
}