From 1cb6ca4f5c149e6563ccbc45e104c4716f76764e Mon Sep 17 00:00:00 2001 From: BobHanson Date: Sat, 6 Jun 2020 23:00:36 -0500 Subject: [PATCH] JAL-3446 Desktop fix for embedding --- src/jalview/gui/Desktop.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 7115e18..4b25ef2 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -906,12 +906,14 @@ public class Desktop extends GDesktop } openFrameCount++; - + + boolean isEmbedded = (Platform.getEmbeddedAttribute(frame, "id") != null); + boolean hasEmbeddedSize = (Platform.getDimIfEmbedded(frame, -1, -1) != null); + // Web page embedding allows us to ignore minimum size + ignoreMinSize |= hasEmbeddedSize; + if (!ignoreMinSize) { - frame.setMinimumSize( - new Dimension(DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT)); - // Set default dimension for Alignment Frame window. // The Alignment Frame window could be added from a number of places, // hence, @@ -920,6 +922,10 @@ public class Desktop extends GDesktop { frame.setMinimumSize(new Dimension(ALIGN_FRAME_DEFAULT_MIN_WIDTH, ALIGN_FRAME_DEFAULT_MIN_HEIGHT)); + } else { + frame.setMinimumSize( + new Dimension(DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT)); + } } @@ -929,7 +935,6 @@ public class Desktop extends GDesktop frame.setMaximizable(resizable); frame.setIconifiable(resizable); frame.setOpaque(Platform.isJS()); - boolean isEmbedded = (Platform.getDimIfEmbedded(frame, -1, -1) != null); if (!isEmbedded && frame.getX() < 1 && frame.getY() < 1) { frame.setLocation(xOffset * openFrameCount, -- 1.7.10.2