From 432b6fdfd697c0e0cd80a482217370c98841c960 Mon Sep 17 00:00:00 2001 From: Abraham Wolk Date: Thu, 7 Aug 2025 11:06:22 +0200 Subject: [PATCH 1/2] CSSTUDIO-3364 Bugfix: restore Zoom-level when restoring a layout. --- .../runtime/app/DisplayRuntimeInstance.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DisplayRuntimeInstance.java b/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DisplayRuntimeInstance.java index edff92f24c..430a02e500 100644 --- a/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DisplayRuntimeInstance.java +++ b/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DisplayRuntimeInstance.java @@ -244,9 +244,20 @@ public void restore(final Memento memento) { memento.getString(TAG_ZOOM).ifPresent(level -> { - // Simulate user input: Set value, invoke handler - zoom_action.setValue(level); - zoom_action.getOnAction().handle(null); + Platform.runLater(() -> { + // Simulate user input: Set value, invoke handler + // + // Run this inside Platform.runLater(), since + // the constructor of ZoomAction also sets the zoom- + // level (to 100%) using Platform.runLater(). + // When restoring an instance of Display Runtime, + // DisplayRuntime.restore() is called _after_ + // the constructor of ZoomAction is called and + // Platform.runLater() preserves the relative + // ordering of Runnables when running them. + zoom_action.setValue(level); + zoom_action.getOnAction().handle(null); + }); }); memento.getBoolean(TAG_TOOLBAR).ifPresent(this::showToolbar); } From 5b9b254b714139a7f5a6f14d9c6836cd602845f3 Mon Sep 17 00:00:00 2001 From: Abraham Wolk Date: Thu, 7 Aug 2025 11:14:40 +0200 Subject: [PATCH 2/2] CSSTUDIO-3364 Clarify comment. --- .../display/builder/runtime/app/DisplayRuntimeInstance.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DisplayRuntimeInstance.java b/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DisplayRuntimeInstance.java index 430a02e500..ef64dd730e 100644 --- a/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DisplayRuntimeInstance.java +++ b/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DisplayRuntimeInstance.java @@ -249,8 +249,10 @@ public void restore(final Memento memento) // // Run this inside Platform.runLater(), since // the constructor of ZoomAction also sets the zoom- - // level (to 100%) using Platform.runLater(). - // When restoring an instance of Display Runtime, + // level (to the value set by the option + // 'default_zoom_factor', which by default is set + // to 100%) using Platform.runLater(). When + // restoring an instance of Display Runtime, // DisplayRuntime.restore() is called _after_ // the constructor of ZoomAction is called and // Platform.runLater() preserves the relative