fix(gui): use UI thread for scroll in code (#2798)

This commit is contained in:
Skylot
2026-02-23 21:04:41 +00:00
parent 4b9d69a169
commit 9957f694b9
2 changed files with 6 additions and 3 deletions
@@ -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