Skip to content

Non-focused windows reported as having focus when toggling alwaysOnTop property #499

@Nohus

Description

@Nohus

Originally reported in the Compose Multiplatform bug tracker, but turns out this is a JVM bug: https://youtrack.jetbrains.com/issue/CMP-7434/LocalWindowInfo.current.isWindowFocused-reports-true-for-not-focused-windows

On Windows, when a non-focused window has it's alwaysOnTop property changed, either from false to true, or true to false, Swing starts to report it as having focus, and windowGainedFocus fires. The window does not actually get focused (which is correct), it's just wrongly reported as having focus, and is stuck in this state until it actually gets focused.

See the linked bug for reproducer samples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions