Skip to content

Commit f49eeaf

Browse files
committed
fix for issue #392 JavaFX incorrect initial window size on Ubuntu
1 parent e191730 commit f49eeaf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ui/src/main/java/org/adoptopenjdk/jitwatch/ui/stage/StageManager.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ public static void addAndShow(final Stage parent, final Stage childStage)
153153
{
154154
addAndShow(parent, childStage, null);
155155

156+
// fetch scene size and resize window due to JavaFX bug
157+
// reported in https://github.com/AdoptOpenJDK/jitwatch/issues/392
158+
double width = childStage.getScene().widthProperty().get();
159+
double height = childStage.getScene().heightProperty().get();
160+
161+
childStage.setWidth(width);
162+
childStage.setHeight(height);
156163
}
157164

158165
public static void addAndShow(final Stage parent, final Stage childStage, final IStageClosedListener closedListener)

0 commit comments

Comments
 (0)