From c551e2bae197b93d7b4dac0169f6d81b4c0958a6 Mon Sep 17 00:00:00 2001 From: Elsa Zacharia Date: Thu, 11 Jan 2024 09:56:04 +0530 Subject: [PATCH] fixup: addressed the review comments. --- .../cocoa/org/eclipse/swt/dnd/DropTarget.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java index bae33233df..731bf1c8a1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/cocoa/org/eclipse/swt/dnd/DropTarget.java @@ -443,13 +443,18 @@ static long dropTargetProc(long id, long sel, long arg0) { Widget widget = display.findWidget(id); if (widget == null) return 0; DropTarget dt = (DropTarget) widget.getData(DND.DROP_TARGET_KEY); - if (dt == null) { - while (widget != null && (widget instanceof Label || !(widget instanceof Shell))) { - Composite widgetParent = ((Control) widget).getParent(); - dt = (DropTarget) widgetParent.getData(DND.DROP_TARGET_KEY); - widget = widgetParent; - if (dt != null) break; - } + if (dt == null && widget instanceof Label) { + while (widget != null && !(widget instanceof Shell)) { + dt = (DropTarget) widget.getData(DND.DROP_TARGET_KEY); + if (dt != null) { + break; + } + if (widget instanceof Control) { + Composite widgetParent = ((Control) widget).getParent(); + widget = widgetParent; + } + else break; + } } if (dt == null) return 0;