RFR: 8364547: Window size may be incorrect when constrained to min or max
Kevin Rushforth
kcr at openjdk.org
Fri Aug 15 16:58:18 UTC 2025
On Thu, 14 Aug 2025 16:26:07 GMT, Martin Fox <mfox at openjdk.org> wrote:
> When changing the width and height of a window the platform code is responsible for enforcing the min and max size constraints. If the final width and height don't match the width and height passed into setBounds the platform needs to call notifyResize to correct the window's properties. This happens naturally if the window size actually changes since that will trigger the OS to send size change notifications. If the platform window size doesn't change the OS notifications won't trigger. We need to catch that case and send notifyResize anyway.
>
> This PR does this for Mac and Windows. Linux is being handled in PR #1789 which also includes the system tests for these bugs.
This looks reasonable although I haven't tested it. I left one question inline. I presume you have run all systems tests?
modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinWindow.java line 161:
> 159: if (minMaxEnforced) {
> 160: notifyResize(WindowEvent.RESIZE, pw, ph);
> 161: }
Could this lead to two resize commands in some cases? I can see why this new logic is needed for the case where the window was already at max (or min) width and height, but if it wasn't already constrained, wouldn't the resize event have already happened?
-------------
PR Review: https://git.openjdk.org/jfx/pull/1870#pullrequestreview-3124545046
PR Review Comment: https://git.openjdk.org/jfx/pull/1870#discussion_r2279485765
More information about the openjfx-dev
mailing list