Skip to content

Commit

Permalink
485245: UI freeze in MarketplaceDropAdapter.hookRecursive (2.1s)
Browse files Browse the repository at this point in the history
Avoid UI freezes when hooking d&d into deeply nested widget trees.

Change-Id: I981ad5655ad55799058e11e3c790e2910a6bc932
Signed-off-by: Leif Geiger <geiger@yatta.de>
  • Loading branch information
Leif Geiger committed Feb 25, 2019
1 parent 4906c19 commit 336a746
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ private void hookRecursive(Control child, DropTargetListener dropListener) {
}
if (child instanceof Composite) {
Composite composite = (Composite) child;
Control[] children = composite.getChildren();
for (Control control : children) {
hookRecursive(control, dropListener);
}
// Bug 485245 - avoid UI freezes for deeply nested widget trees
composite.getDisplay().asyncExec(() -> {
Control[] children = composite.getChildren();
for (Control control : children) {
hookRecursive(control, dropListener);
}
});
}
}

Expand Down

0 comments on commit 336a746

Please sign in to comment.