On Mon, 9 Nov 2020 11:34:25 GMT, Jose Pereda <jper...@openjdk.org> wrote:
> As commented in the [JBS > issue](https://bugs.openjdk.java.net/browse/JDK-8199592), the default UI > scale 1.0 is used to perform initial calculations of preferred sizes of the > scene, even if the scale has already a different value (i.e 175%). As a > workaround, calling `Stage::sizeToScene` fix it, as it forces to do new > calculations but now with the correct UI scale. > > This PR moves the call to `Window::updateOutputScales` before the scene > initialization takes place, so the UI scale is correctly set for the initial > preferred size of the scene, and no workaround is required. > > It also provides a system test that can be tested on Linux and Windows. > Before applying the fix, the `Check` text of the checkboxes is rendered as > `Che...`. With the fix, the test verifies, for a given UI scale, that the > rendered text is `Check`. Looks good to me, but I want to run one more test on a dual screen setup tomorrow. I think that switching the order makes sense, and I can see no problems that it will cause. I am reasonably certain that whatever reason may have existed for the current order no longer pertains (there was a significant change to how screen scales were computed and tracked as a follow-on fix to the original HiDPI code that added the current block that you are moving). I verified that the new test catches the bug. I added one minor suggestion. ------------- PR: https://git.openjdk.java.net/jfx/pull/351