United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7124262 [macosx] Drag events go to a wrong child.
JDK-7124262 : [macosx] Drag events go to a wrong child.

Details
Type:
Bug
Submit Date:
2011-12-23
Status:
Closed
Updated Date:
2013-10-22
Project Name:
JDK
Resolved Date:
2012-03-19
Component:
client-libs
OS:
os_x
Sub-Component:
java.awt
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7u4
Fixed Versions:
7u4 (b16)

Related Reports
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Duplicate:

Sub Tasks

Description
http://java.net/jira/browse/MACOSX_PORT-693 submitted 2011/11/11 by Yuri Nesterenko
Run the attached example adapted from a test. Here InnerDropTargetPanel extends DropTargetPanel (which is a Panel). It (Inner one) has overridden all methods of DropTargetPanel necessary to implement DropTargetListener. 
A smaller InnerDropTargetPanel is added to the top of a bigger DropTargetPanel. Look at the printout: all is OK with relative sizes of them, as reported.
Now, Robot (and later you may do it manually) drags from a bottom Button, and drag messages start coming immediately to the InnerDropTargetPanel even if it is nor reached yet. Even more, when you reach the InnerDropTargetPanel, it does receive DropExit. It's really bizarre.

                                    

Comments
EVALUATION

Author: Yuri Nesterenko Date: 11/Nov/11 08:00 AM
Build: b216
closed/java/awt/dnd/NestedHeavyweightDropTargetTest/NestedHeavyweightDropTargetTest
                                     
2011-12-23
EVALUATION

This happens because we are wrongly install native Drag recognized on the AWTView for the second time for the AWT components - hence the last added components will receive all the Drag events. The fix is to add the DropTarget listener only to the window peer if component is added to the window.
                                     
2012-02-22
Affected version 7 replaced by affected version 7u4 because failures in aurora map on this bug.
                                     
2013-10-22



Hardware and Software, Engineered to Work Together