From e69da5d5b63e3433f51bede3716034d0d16daa08 Mon Sep 17 00:00:00 2001 From: crschnick Date: Sat, 15 Mar 2025 08:43:54 +0000 Subject: [PATCH] Don't animate transition in performance mode --- .../main/java/io/xpipe/app/core/AppTheme.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/core/AppTheme.java b/app/src/main/java/io/xpipe/app/core/AppTheme.java index 23979e919..6c13f1687 100644 --- a/app/src/main/java/io/xpipe/app/core/AppTheme.java +++ b/app/src/main/java/io/xpipe/app/core/AppTheme.java @@ -210,19 +210,26 @@ public class AppTheme { } PlatformThread.runLaterIfNeeded(() -> { - if (AppMainWindow.getInstance() == null) { + var window = AppMainWindow.getInstance(); + if (window == null) { return; } - var window = AppMainWindow.getInstance().getStage(); - var scene = window.getScene(); + TrackEvent.debug("Setting theme " + newTheme.getId() + " for scene"); + + // Don't animate transition in performance mode + if (AppPrefs.get() == null || AppPrefs.get().performanceMode().get()) { + newTheme.apply(); + return; + } + + var stage = window.getStage(); + var scene = stage.getScene(); Pane root = (Pane) scene.getRoot(); Image snapshot = scene.snapshot(null); ImageView imageView = new ImageView(snapshot); root.getChildren().add(imageView); - newTheme.apply(); - TrackEvent.debug("Set theme " + newTheme.getId() + " for scene"); Platform.runLater(() -> { // Animate!