diff --git a/app/src/main/java/io/xpipe/app/comp/base/ListBoxViewComp.java b/app/src/main/java/io/xpipe/app/comp/base/ListBoxViewComp.java index 64e3a475f..8cb42e1dc 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/ListBoxViewComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/ListBoxViewComp.java @@ -26,6 +26,7 @@ import javafx.scene.layout.VBox; import lombok.Setter; import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Function; public class ListBoxViewComp extends Comp> { @@ -60,10 +61,23 @@ public class ListBoxViewComp extends Comp> { vbox.setFocusTraversable(false); var scroll = new ScrollPane(vbox); - refresh(scroll, vbox, shown, all, cache, false, false); + refresh(scroll, vbox, shown, all, cache, false); + + var hadScene = new AtomicBoolean(false); + scroll.sceneProperty().subscribe(scene -> { + if (scene != null) { + hadScene.set(true); + } + }); shown.addListener((ListChangeListener) (c) -> { - refresh(scroll, vbox, c.getList(), all, cache, true, true); + Platform.runLater(() -> { + if (scroll.getScene() == null && hadScene.get()) { + return; + } + + refresh(scroll, vbox, c.getList(), all, cache, true); + }); }); if (scrollBar) { @@ -228,7 +242,6 @@ public class ListBoxViewComp extends Comp> { List shown, List all, Map cache, - boolean asynchronous, boolean refreshVisibilities) { Runnable update = () -> { synchronized (cache) { @@ -244,10 +257,6 @@ public class ListBoxViewComp extends Comp> { var shownCopy = new ArrayList<>(shown); var newShown = shownCopy.stream() .map(v -> { - if (asynchronous && scroll.getScene() == null) { - return null; - } - if (!cache.containsKey(v)) { var comp = compFunction.apply(v); if (comp != null) { @@ -284,11 +293,6 @@ public class ListBoxViewComp extends Comp> { updateVisibilities(scroll, listView); } }; - - if (asynchronous) { - Platform.runLater(update); - } else { - PlatformThread.runLaterIfNeeded(update); - } + update.run(); } } diff --git a/dist/changelogs/15.7_incremental.md b/dist/changelogs/15.7_incremental.md index 0f434a75b..9bf6ef5cd 100644 --- a/dist/changelogs/15.7_incremental.md +++ b/dist/changelogs/15.7_incremental.md @@ -1,5 +1,13 @@ +## Performance + +A severe performance regression was accidentally introduced in the recent 15.4 release. This release fixes this issue, so you will get much better performance in this version. It is recommended that you upgrade to 15.7. + +While investigating, there were also a few other performance issues discovered that will be addressed in one of the next releases. + +## Changes + - Add support for Warp on Windows and Linux -- Fix right part of file browser becoming blocked after a split tab is merged again +- Fix right part of file browser becoming blocked after a tab is split - Fix tailscale refresh operations failing with an out-of-bounds error in some cases - Fix vmware .vmx failing to load if they had an unknown encoding - Fix some translations diff --git a/version b/version index 8ede0276f..b5a3208b7 100644 --- a/version +++ b/version @@ -1 +1 @@ -15.7-3 +15.7