On Fri, 15 Aug 2025 16:53:47 GMT, Kevin Rushforth <k...@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.
>
> 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?

The issue is that the Java side updates the property first, and only afterward 
requests the Glass native side to apply the change. I've found this to cause 
many problems and I fixed the same way in  #1789 - when the change can't be 
applied, it notifies back.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1870#discussion_r2279535073

Reply via email to