Skip to content

fix: use CGMainDisplayID() instead of NSScreen.main for primary display detection#21

Merged
typester merged 1 commit intomainfrom
fix/main-display-detection
Feb 19, 2026
Merged

fix: use CGMainDisplayID() instead of NSScreen.main for primary display detection#21
typester merged 1 commit intomainfrom
fix/main-display-detection

Conversation

@typester
Copy link
Owner

NSScreen.main returns the screen with keyboard focus (key window), not the primary display with the menu bar. This caused items without an explicit display to migrate to the wrong screen on display change events. Use CGMainDisplayID() which always returns the menu bar display.

…ay detection

NSScreen.main returns the screen with keyboard focus (key window), not the
primary display with the menu bar. This caused items without an explicit
display to migrate to the wrong screen on display change events. Use
CGMainDisplayID() which always returns the menu bar display.
@typester typester merged commit 41efff4 into main Feb 19, 2026
2 checks passed
@typester typester deleted the fix/main-display-detection branch February 19, 2026 22:27
typester pushed a commit that referenced this pull request Feb 19, 2026
🤖 I have created a release *beep* *boop*
---


## [0.1.9](v0.1.8...v0.1.9)
(2026-02-19)


### Bug Fixes

* use CGMainDisplayID() instead of NSScreen.main for primary display
detection ([#21](#21))
([41efff4](41efff4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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