-
Bug
-
Resolution: Unresolved
-
P4
-
jfx23
-
windows
Running a JavaFX application with a label and a menubar and some menus/menuItems on Windows, with a single monitor and a given HiDPI setup (let's say 125%), shows the correct font for label and the menubar, and the position of the context menu is correct, as expected.
However, without closing the application (but with the menu closed), if the HiDPI changes (let's say to 150%), the font of the main stage (including menuBar) doesn't get updated, the renderScale property remains unchanged, but when opening the menu, the contextMenu shows the correct font for the menuItems, but with an unexpected offset.
The attached test can be used to reproduce the issue:
- On Windows, set screen resolution to 125%.
- Run the application, open the menu (all good, see MainApp125.png), close it.
- Go to Control Panel -> Screen -> set the screen resolution to 150%.
- Notice that JavaFX application gets resized, the Windows buttons rescaled, but font for menuBar and label remain unscaled, renderScale property still shows 125%. Open the menu, it is rescaled to 150%, but offset is wrong (see MainApp150.png).
- Close the application, restart it (it shows everything fine again for 150%, see MainApp150restarted.png)
However, without closing the application (but with the menu closed), if the HiDPI changes (let's say to 150%), the font of the main stage (including menuBar) doesn't get updated, the renderScale property remains unchanged, but when opening the menu, the contextMenu shows the correct font for the menuItems, but with an unexpected offset.
The attached test can be used to reproduce the issue:
- On Windows, set screen resolution to 125%.
- Run the application, open the menu (all good, see MainApp125.png), close it.
- Go to Control Panel -> Screen -> set the screen resolution to 150%.
- Notice that JavaFX application gets resized, the Windows buttons rescaled, but font for menuBar and label remain unscaled, renderScale property still shows 125%. Open the menu, it is rescaled to 150%, but offset is wrong (see MainApp150.png).
- Close the application, restart it (it shows everything fine again for 150%, see MainApp150restarted.png)