On Fri, 6 Mar 2026 19:54:10 GMT, Jose Pereda <[email protected]> wrote:

>> This PR adds a fix to prevent a crash on macOS after exiting full screen 
>> mode when a modal dialog is showing 
>> (https://bugs.openjdk.org/browse/JDK-8371370).
>> 
>> At the same time, it prevents non-resizable windows from entering full 
>> screen mode (https://bugs.openjdk.org/browse/JDK-8379315), given that the 
>> changes for both issues were interrelated.
>> 
>> While no tests have been added, manual tests have been run, checking that 
>> the style mask, the window behavior and the standard window buttons state, 
>> remained consistent in different scenarios.
>> 
>> Also, according to 
>> https://developer.apple.com/documentation/appkit/nswindow/showsresizeindicator,
>>  the `showsResizeIndicator` property has been removed.
>
> Jose Pereda has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   fix typo and remove unused property

About Undecorated windows:

Currently (before this PR), you can indeed have:

    primaryStage.initStyle(StageStyle.UNDECORATED);
    primaryStage.setFullScreen(true);

and even:

    primaryStage.initStyle(StageStyle.UNDECORATED);
    primaryStage.setResizable(false);
    primaryStage.setFullScreen(true);

and on macOS the window will enter full screen mode, as a regular decorated 
window, and be resized, even if it is marked as non resizable.

With this PR, that is no longer the case. 

The JavaFX definition of Undecorated does mention it supports fullscreen mode, 
and for non-resizable windows, it mentions that it can be resized 
programmatically, but it doesn't specify if it can enter fullscreen mode.

However:
- Native macOS applications that are non resizable can't enter fullscreen mode, 
unless programmatically enabling the `NSWindowStyleMaskResizable` flag, which 
is the same as making them resizable. 
- Native macOS applications that are undecorated (without the title bar) can't 
enter fullscreen mode either, without the `NSWindowStyleMaskTitled` flag. The 
alternative for this would be keeping the title bar, but hiding the title text 
and making a transparent title bar, but that will keep the buttons, so that 
wouldn't match the undecorated definition.

With this PR, I tried to follow those macOS conventions, (so now neither 
undecorated nor non-resizable windows can't enter full screen on macOS), but I 
do realize that it implies some inconsistencies for the Undecorated stages.

The question I have: do we want to follow this path (keep macOS conventions) 
and deal with the required changes for undecorated windows? Or do we keep it as 
it was, allowing undecorated windows entering full screen mode?

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

PR Comment: https://git.openjdk.org/jfx/pull/2098#issuecomment-4030796908

Reply via email to