diff options
author | Silenio Quarti <silenio> | 2010-08-06 16:00:09 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2010-08-06 16:00:09 +0000 |
commit | 71c48e166964592243c07390c62aa162ec42ae4d (patch) | |
tree | b547271aa88c04ca150e8d77e9ffd37489470414 | |
parent | 23531f1d86bcc98938a4e0b3a194b661def5d419 (diff) | |
download | eclipse.platform.swt-71c48e166964592243c07390c62aa162ec42ae4d.tar.gz eclipse.platform.swt-71c48e166964592243c07390c62aa162ec42ae4d.tar.xz eclipse.platform.swt-71c48e166964592243c07390c62aa162ec42ae4d.zip |
Bug 312365 - Carbon: DnD fails when dropping object to a child control. (back port to 3.6.x)
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/carbon/org/eclipse/swt/dnd/DropTarget.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/carbon/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/carbon/org/eclipse/swt/dnd/DropTarget.java index aee31ffccc..af52555b17 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/carbon/org/eclipse/swt/dnd/DropTarget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/carbon/org/eclipse/swt/dnd/DropTarget.java @@ -279,10 +279,17 @@ static DropTarget FindDropTarget(int theWindow, int theDrag) { OS.SetEventParameter (event[0], OS.kEventParamWindowMouseLocation, OS.typeHIPoint, CGPoint.sizeof, inPoint); OS.HIViewGetViewForMouseEvent (theRoot [0], event [0], theControl); OS.ReleaseEvent(event[0]); - if (!OS.IsControlEnabled(theControl[0])) return null; - Widget widget = display.findWidget(theControl[0]); - if (widget == null) return null; - return (DropTarget)widget.getData(DND.DROP_TARGET_KEY); + if (!OS.IsControlEnabled(theControl[0])) return null; + DropTarget dropTarget = null; + do { + Widget widget = display.findWidget(theControl[0]); + if (widget != null) { + dropTarget = (DropTarget) widget.getData(DND.DROP_TARGET_KEY); + if (dropTarget != null) break; + } + OS.GetSuperControl (theControl [0], theControl); + } while (theControl [0] != 0); + return dropTarget; } /** * Adds the listener to the collection of listeners who will |