RFR: 8371106: [macOS] Min/max window height is incorrect for EXTENDED StageStyle

Michael Strauß mstrauss at openjdk.org
Mon Nov 10 20:21:02 UTC 2025


On Mon, 10 Nov 2025 20:04:14 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> This patch fixes window size contraints for an `EXTENDED` stage. In contrast to the suggested workaround in the JBS ticket of querying the value of [`NSWindow.minSize`](https://developer.apple.com/documentation/appkit/nswindow/minsize?language=objc) to find out the added size for the toolbar, I've found it easier to set the [`NSWindow.contentMinSize`](https://developer.apple.com/documentation/appkit/nswindow/contentminsize?language=objc) property instead.
>> 
>> This is only done for `EXTENDED` stages, preserving the existing behavior for all other stage styles, and it works because extended stages use a full-size content view that covers the entire window. It also makes it unnecessary to take the toolbar height into consideration, which would be necessary if we used the `minSize` property instead.
>
> modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m line 1237:
> 
>> 1235:     {
>> 1236:         GlassWindow *window = getGlassWindow(env, jPtr);
>> 1237:         NSSize minSize = NSMakeSize(jW, jH);
> 
> Does this structure need to be freed at some point?

It's a value struct, no heap allocation going on. So it doesn't need to be freed.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1967#discussion_r2511853962


More information about the openjfx-dev mailing list