From c3a90c7ffdccd4ed6d4b6f6817295eaedc18629f Mon Sep 17 00:00:00 2001 From: Rebecca Williams Date: Mon, 13 Jul 2026 12:50:31 +0100 Subject: [PATCH 1/2] Configure stage size and position before it is shown when opening a display in a new window from an action. This avoids flickering due to the unnecessary resizing and repositioning of the stage. --- .../runtime/app/DockItemRepresentation.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DockItemRepresentation.java b/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DockItemRepresentation.java index 6d88de053f..2ceeb237c0 100644 --- a/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DockItemRepresentation.java +++ b/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DockItemRepresentation.java @@ -59,9 +59,6 @@ public ToolkitRepresentation openNewWindow(final DisplayModel mode // Open new Stage final Stage new_stage = new Stage(); - // Configure for docking, i.e. with DockPane - DockStage.configureStage(new_stage, new Geometry(null), model.isStandalone()); - // Use location and size from model for the window double x = model.propX().getValue(); double y = model.propY().getValue(); @@ -78,8 +75,6 @@ public ToolkitRepresentation openNewWindow(final DisplayModel mode y = window.getY(); } } - new_stage.setX(x); - new_stage.setY(y); // Size needs to account for the border and toolbar. // Using fixed numbers, exact size of border and toolbar unknown @@ -89,12 +84,15 @@ public ToolkitRepresentation openNewWindow(final DisplayModel mode // Don't need to include space for toolbar in standalone if (model.isStandalone()) { - width_margin = 5; - height_margin = 40; + width_margin = 2; + height_margin = 4; } - new_stage.setWidth(model.propWidth().getValue() + width_margin); - new_stage.setHeight(model.propHeight().getValue() + height_margin); + // Configure for docking, i.e. with DockPane + String geometry_string = (model.propWidth().getValue() + width_margin) + + "x"+(model.propHeight().getValue() + height_margin) + + "+" +((int) x) + "+" +((int) y); + DockStage.configureStage(new_stage, new Geometry(geometry_string), model.isStandalone()); new_stage.show(); // New DockPane is now the 'active' one, From fb379cd52195f44a0f2fc775c64409d286212b4c Mon Sep 17 00:00:00 2001 From: Rebecca Williams Date: Tue, 17 Nov 2026 12:11:36 +0000 Subject: [PATCH 2/2] Fix linting --- .../display/builder/runtime/app/DockItemRepresentation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DockItemRepresentation.java b/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DockItemRepresentation.java index 2ceeb237c0..fb5ddee39e 100644 --- a/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DockItemRepresentation.java +++ b/app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/DockItemRepresentation.java @@ -99,7 +99,7 @@ public ToolkitRepresentation openNewWindow(final DisplayModel mode // model will be opened in it. return representModelInNewDockItem(model); } - + @Override public ToolkitRepresentation openStandaloneWindow(final DisplayModel model, final Consumer close_handler)