Skip to content

Commit

Permalink
fixup: addressed the review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsazac committed Jan 11, 2024
1 parent a7a1c8b commit c551e2b
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c551e2b

Please sign in to comment.