File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -244,9 +244,20 @@ public void restore(final Memento memento)
244244 {
245245 memento .getString (TAG_ZOOM ).ifPresent (level ->
246246 {
247- // Simulate user input: Set value, invoke handler
248- zoom_action .setValue (level );
249- zoom_action .getOnAction ().handle (null );
247+ Platform .runLater (() -> {
248+ // Simulate user input: Set value, invoke handler
249+ //
250+ // Run this inside Platform.runLater(), since
251+ // the constructor of ZoomAction also sets the zoom-
252+ // level (to 100%) using Platform.runLater().
253+ // When restoring an instance of Display Runtime,
254+ // DisplayRuntime.restore() is called _after_
255+ // the constructor of ZoomAction is called and
256+ // Platform.runLater() preserves the relative
257+ // ordering of Runnables when running them.
258+ zoom_action .setValue (level );
259+ zoom_action .getOnAction ().handle (null );
260+ });
250261 });
251262 memento .getBoolean (TAG_TOOLBAR ).ifPresent (this ::showToolbar );
252263 }
You can’t perform that action at this time.
0 commit comments