Skip to content

fix(macos): wait for status item layout before placing TrayApp popup - #430

Merged
kdroidFilter merged 1 commit into
masterfrom
fix/macos-tray-popup-top-left
Aug 27, 2026
Merged

fix(macos): wait for status item layout before placing TrayApp popup#430
kdroidFilter merged 1 commit into
masterfrom
fix/macos-tray-popup-top-left

Conversation

@kdroidFilter

Copy link
Copy Markdown
Collaborator

Summary

  • AppKit parks a new NSStatusItem at the menu-bar left edge until layout. TrayApp treated that as a precise anchor, so initiallyVisible popups opened at the top-left ~2/3 of launches.
  • Native geometry APIs now report "not ready" until the item has a laid-out slot.
  • getTrayWindowPositionForInstance returns PlatformDefault for an unlaid-out rect; awaitAnchoredWindowPosition waits for two stable usable reads instead of latching the first non-default value.

Test plan

  • AwaitAnchoredWindowPositionTest fails on the old first-read poller, passes after the fix
  • MacTrayWindowPositionE2ETest (real NSStatusItem, 6 trials) never latches the work-area origin
  • ./gradlew :tray-app:jvmTest ktlintCheck

@kdroidFilter
kdroidFilter force-pushed the fix/macos-tray-popup-top-left branch from 250a501 to b1f36f4 Compare August 27, 2026 23:37
@kdroidFilter
kdroidFilter merged commit 72f1d99 into master Aug 27, 2026
5 checks passed
@kdroidFilter
kdroidFilter deleted the fix/macos-tray-popup-top-left branch August 27, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant