RFR: 8372453: [macOS] Iconifying owner may not iconify owned window
Andy Goryachev
angorya at openjdk.org
Wed Nov 26 19:31:06 UTC 2025
On Tue, 25 Nov 2025 17:26:36 GMT, Martin Fox <mfox at openjdk.org> wrote:
> In the macOS glass code an owned window is referred to as a child window and its owner is referred to as the parent. When a parent is iconified the glass code "iconifies" its children which is to say it hides them. Under the right circumstances the children may get ordered back to the front and made visible almost immediately.
>
> Details are in the bug report but when a window is iconified it may trigger the OS to notify every window that its NSScreen has changed (yes, this is weird). This causes reorderChildWindows to be called on the newly iconified parent and the process of re-ordering the child windows can cause hidden windows to be made visible. For some reason the NSScreen strangeness only happens if "System Settings > Desktop & Dock > Minimize windows into application icon" is turned OFF. This is not the first time we've encountered this, see [JDK-8353902](https://bugs.openjdk.org/browse/JDK-8353902)
>
> This PR fixes the problem in two ways. If reorderChildWindows is called on an iconified window it does nothing. If one of the child windows is hidden it is not re-ordered since that might make it visible.
It's weird, I cannot reproduce the issue in master (26.1 on M1 silicon). I wonder if there is some other settings that have to be set in order to reproduce.
Here is my Desktop&Dock:
<img width="493" height="1012" alt="Image" src="https://github.com/user-attachments/assets/9e5dab3c-11bb-4a46-b017-1bbbd536f5d3" />
Approving since @kevinrushforth tested the fix.
modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m line 379:
> 377: [child->nsWindow setLevel:level];
> 378: // Order child above the owner window
> 379: if (child->nsWindow.isVisible) {
there is no chance for `child->nsWindow` to be `nil`, is there?
-------------
Marked as reviewed by angorya (Reviewer).
PR Review: https://git.openjdk.org/jfx/pull/1985#pullrequestreview-3512434660
PR Review Comment: https://git.openjdk.org/jfx/pull/1985#discussion_r2566225072
More information about the openjfx-dev
mailing list