fix(gui): use UI thread for scroll in code (#2798)
This commit is contained in:
@@ -9,8 +9,8 @@ import jadx.core.utils.tasks.TaskExecutor;
|
||||
public class SilentTask extends CancelableBackgroundTask {
|
||||
private final Runnable task;
|
||||
|
||||
public SilentTask(Runnable task) {
|
||||
this.task = task;
|
||||
public SilentTask(Runnable backgroundTask) {
|
||||
this.task = backgroundTask;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -221,6 +221,7 @@ public class TabbedPane extends JTabbedPane implements ITabStatesListener {
|
||||
}
|
||||
|
||||
private @Nullable ContentPanel showCode(JumpPosition jumpPos) {
|
||||
UiUtils.uiThreadGuard();
|
||||
JNode jumpNode = jumpPos.getNode();
|
||||
ContentPanel contentPanel = getTabByNode(jumpNode);
|
||||
if (contentPanel == null) {
|
||||
@@ -442,7 +443,9 @@ public class TabbedPane extends JTabbedPane implements ITabStatesListener {
|
||||
@Override
|
||||
public void onTabCodeJump(TabBlueprint blueprint, @Nullable JumpPosition prevPos, JumpPosition position) {
|
||||
// queue task to wait completion of loading tasks
|
||||
mainWindow.getBackgroundExecutor().execute(new SilentTask(() -> showCode(position)));
|
||||
mainWindow.getBackgroundExecutor().execute(new SilentTask(() -> {
|
||||
UiUtils.uiRun(() -> showCode(position));
|
||||
}));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user