Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8346281

[Windows] RenderScale doesn't update to HiDPI changes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • jfx25
    • jfx23
    • javafx

      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)

        1. MainApp125.png
          MainApp125.png
          35 kB
        2. MainApp150.png
          MainApp150.png
          34 kB
        3. MainApp150restarted.png
          MainApp150restarted.png
          24 kB

            jpereda Jose Pereda
            jpereda Jose Pereda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: