On Mon, 16 Nov 2026 10:52:39 GMT, Jose Pereda <[email protected]> wrote:

> This PR removes the stage from the active windows list after the stage gets 
> hidden/closed, preventing a possible NPE in WindowStage::setIconified.
> 
> Similar to [JDK-8387626](https://bugs.openjdk.org/browse/JDK-8387626), that 
> got fixed removing the stage from the active windows list after there was a 
> `WindowEvent.DESTROY` event in `GlassWindowEventHandler::get`, in this case 
> the Window::hide` event doesn't produce a `WindowEvent.CLOSE` event. 
> Therefore, the fix goes directly in `WindowStage::close`.
> 
> A system test that fails before the proposed fix, and passes after it, has 
> been included.
> 
> ---------
> - [X] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Changes requested by angorya (Reviewer).

tests/system/src/test/java/test/javafx/stage/CloseWindowTest.java line 114:

> 112: 
> 113:             secondaryStage.setOnHidden(_ -> {
> 114:                 doneLatch.countDown();

this release might prematurely end the test even if NPE occurs.
should we release until after the focus events have been processed?

tests/system/src/test/java/test/javafx/stage/CloseWindowTest.java line 123:

> 121:         }
> 122:     }
> 123: 

extra newline

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

PR Review: https://git.openjdk.org/jfx/pull/2373#pullrequestreview-5923436039
PR Review Comment: https://git.openjdk.org/jfx/pull/2373#discussion_r4588554898
PR Review Comment: https://git.openjdk.org/jfx/pull/2373#discussion_r4588376477

Reply via email to