Skip to content

fix(macos): anchor popover to clicked display - #6

Open
60dage wants to merge 1 commit into
manustays:mainfrom
60dage:bugfix/multi-display-popover
Open

fix(macos): anchor popover to clicked display#6
60dage wants to merge 1 commit into
manustays:mainfrom
60dage:bugfix/multi-display-popover

Conversation

@60dage

@60dage 60dage commented Aug 25, 2026

Copy link
Copy Markdown

Closes #5

Summary

  • capture the macOS status-item click in native AppKit coordinates
  • select the containing NSScreen and position the NSWindow against its visibleFrame
  • remember the last native screen so a click on another display moves an open popover there, while a same-display click still toggles it closed
  • retain the existing Positioner path on non-macOS platforms

Why

Tauri's physical monitor coordinates can be inconsistent on vertically arranged mixed-DPI macOS displays. Combining those values with AppKit window coordinates can select the wrong screen or place the popover outside every visible frame.

The click's NSEvent::mouseLocation() is already in the same coordinate space as NSScreen and NSWindow, so keeping the full placement path in AppKit coordinates avoids the scale conversion ambiguity.

Related upstream reports:

Testing

  • cargo check --manifest-path src-tauri/Cargo.toml
  • cargo test --manifest-path src-tauri/Cargo.toml — 95 passed
  • npm test — 8 passed
  • npm run build
  • manual verification with a 1x external display arranged above a 2x Retina display:
    • lower → upper → lower → upper clicks
    • popover appeared under the clicked menu bar icon on both displays
    • full webview content remained visible after the final Vite reload

The reproduction setup is documented in #5; before/after screenshots will be attached there.

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.

[macOS] Popover is misplaced or becomes unreachable across mixed-DPI displays

1 participant