fix: position window beside tray on left taskbars#15
Open
afonsojramos wants to merge 1 commit into
Open
Conversation
`bottomLeft` placed the menubar window in the screen's bottom-left corner — visually disconnected from the tray icon, which lives on the left strip. Use `leftCenter` so the window sits vertically centered against the left work-area edge, much closer to where the tray icon actually is. Picks up the bug originally reported in upstream max-mapper#293 by @thomasdarde. Upstream proposed `center`; `leftCenter` stays anchored to the side where the tray lives and is strictly better than both `bottomLeft` and `center`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the OS taskbar is anchored to the left edge of the screen,
getWindowPositionreturned'bottomLeft', which puts the menubar window in the screen's bottom-left corner — visually disconnected from the tray icon. This PR switches that branch to'leftCenter'so the window sits vertically centered against the left work-area edge, much closer to where the tray icon actually lives.Why this design over upstream's
The motivating bug was reported in upstream max-mapper/menubar#293 by @thomasdarde, who patched the (then-current)
'trayBottomLeft'to'center'. Their own commit message says it best: "It's not perfect, but at least not broken."The fork has since moved the value to
'bottomLeft'(which avoids clipping under the taskbar —bottomLeftreads fromworkArea.x, nottray.x), but the window still pops up far from the tray.trayBottomLeft(old upstream)tray.x≈ 0bottomLeft(current main)center(upstream max-mapper#293)leftCenter(this PR)leftCenterresolves to{ x: workArea.x, y: workArea.height / 2 - windowHeight / 2 }inPositioner, so the left edge sits flush against the work area (no clipping) and the window is vertically anchored to the centre of the strip where the tray lives.This isn't pixel-perfect tray anchoring —
Positionerdoesn't have a side-taskbar tray-anchored option — but it's strictly better than the alternatives.Test plan
bun run test— 62/62 passbun run typecheck— cleanbun run lint:check— clean (one pre-existing warning, unrelated)Closes the gap from upstream max-mapper/menubar#293.