Community
Participate
Working Groups
Build Identifier: SWT v3646a DnD fails when dropping object to a child control. So far, we see this issue on Carbon/Mac OS X. Windows works. Reproducible: Always Steps to Reproduce: 1. Create a Composite and setup DropTarget for it. 2. Create a child control in the Composite. 3. Drop an object to the child control. result: the dropped object ignored, and DnD fails. problem: The bug is in DropTarget.FindDropTarget(). The bug happens because DropTarget.FindDropTarget() thinks the DnD object dropped to the child control, But, since the child control's getData() returns null, the line "return (DropTarget) widget.getData(DND.DROP_TARGET_KEY);" returns null. It should return correct parent in this case.
Created attachment 167857 [details] Snippet to reproduce this issue. Steps to reproduce: 1. Run the snippet - X.java 2. Drag the left label 3. Drop to the right Text control. 4. DropTarget.FindDropTarget() returns null, and fails to drop the obj. (that's the bug.) Thanks, Hiro
Created attachment 167858 [details] proposed patch Please review this proposed patch. Thanks, Hiro
Silenio, can you give us your input on the proposed patch?
Silenio, could you review the proposed patch at least ? Our product needs to fix this issue asap. so if the patch looks ok, our product is going to merge it in our swt asap. Thanks, Hiro
Created attachment 168556 [details] fix Sorry about the delay. We are quite busy with the 3.6 end game. This should be the fix. Same idea, but it uses OS calls to get parent instead of Control.getParent().
Thanks Silenio.
Thank you Silenio! We will test the fix with our product and let you know the result. Thanks, Hiro
We verified the fix works with our product. Thanks!
Silenio, can you include this in 3.6.1?
Fix has been release to R3_6_maintenance and HEAD.