Drag and Drop Not Working When Label Contains Image
Describe the bug See https://github.com/eclipse-platform/eclipse.platform.ui/issues/706. There I discovered, that drag and drop breaks when there's a Label containing an image on a composite. The DrapAndDrop is installed on the composite. If I now drag something on the composite this works (you can drop it). As soon as I drag it into the area covered by label's image this no longer works (the green "+" sign disapears and nothing happens on drop). Labels with only text set (but no image) don't have that issue (dropping works fine),
To Reproduce See ReproducerExampler.zip
Expected behavior Also on the area covered by the label's image the gree "+" sign should be visible during drag and drop show also work - just like on the other lables
Screenshots See https://github.com/eclipse-platform/eclipse.platform.ui/issues/706
Environment:
- Select the platform(s) on which the behavior is seen:
-
- [ ] All OS
-
- [ ] Windows
-
- [ ] Linux
-
- [x] macOS
-
Additional OS info (e.g. OS version, Linux Desktop, etc)
-
JRE/JDK version
Version since I think this happens on all SWT versions.
Workaround (or) Additional context There's no workaround
I tried this out in MacOS , was able to reproduce it.I am looking into this issue.
In the snippet provided , if we pass Label (label) as the parameter to DropTarget instead of Composite(comp) in the below line, the drag and drop works correctly over Label containing the image.Label is getting recognised but not the composite.
DropTarget target = new DropTarget(comp, DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT);
Also, For Label below code seems relevant since Label has got an imageView as an extra parameter that needs to be checked.
https://github.com/eclipse-platform/eclipse.platform.swt/blob/b4e274f00d43607d9df00dad6136c72430b823e2/bundles/org.eclipse.swt/Eclipse%20SWT%20Drag%20and%20Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java#L135-L141
Sharing some findings here.Working on this further, will keep you posted once i have next update.
Any progress with this issue?
Any progress with this issue?
Yes.There is progress. Will be raising a patch in 1 or 2 days
@BeckerWdf Sorry for the delay.I will update soon.
Thanks for fixing.
I just re-tested with M1 built. The issue above still exists. So dropping a java file into the editor area does not work on image of the onboarding info.
@elsazac and @lshanmug can you pls have a look?
@BeckerWdf which build are you on?
I am on the below version
Version: 2024-06 (4.32)
Build id: I20240406-1800
and this is how it is for me
https://github.com/eclipse-platform/eclipse.platform.swt/assets/122080218/ecf52224-7d80-4f58-b88b-876ad5f7a637
I did the same with the same i-build. it's not working for me. I used this download: https://download.eclipse.org/eclipse/downloads/drops4/I20240406-1800/download.php?dropFile=eclipse-SDK-I20240406-1800-macosx-cocoa-aarch64.dmg
do you also use aarch64? What macOS version do you have?
do you also use aarch64? What macOS version do you have?
Yes. I use aarch64 and I am on Sonoma 14.4.
I will try to investigate on this.
I am on 14.4.1
I couldn't identify a probable reason on this but this is how it is in I20240406-1800 build on Mac for me.
https://github.com/eclipse-platform/eclipse.platform.swt/assets/122080218/664b0ad2-df4e-40cb-891a-545a3a55e67e