RFR: 8346281: [Windows] RenderScale doesn't update to HiDPI changes [v2]
Jose Pereda
jpereda at openjdk.org
Fri Nov 7 00:35:19 UTC 2025
On Thu, 6 Nov 2025 23:53:10 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Jose Pereda has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Use set and remove unnecessary casting
>
> modules/javafx.graphics/src/main/java/com/sun/glass/ui/Screen.java line 375:
>
>> 373: public static void notifySettingsChanged() {
>> 374: // Save the old screens in order to dispose them later
>> 375: Set<Screen> oldScreens = new HashSet<>();
>
> Does the order matter? I don't think so, but if it does, `LinkedHashSet` would preserve the order.
No, it doesn't matter.
The old screens are "disposed" just by setting their native pointer to 0L, so they can't be reused, while the new screens instances are passed to the windows, to keep an updated instance.
Note that even if old screen and new screen have the very same information (nothing changed for this particular screen), since `WinWindow::notifyMoving` uses the equality operator (`screen 1 == screen 2`), we need to keep a valid instance in `Window::screen`, and therefore `Screen::dispose` is just a way of invalidating old instances. Then, since they are no longer referenced by any window, they can be gc'ed.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1964#discussion_r2501301032
More information about the openjfx-dev
mailing list