fix(macOS): caculation for work area#13401
Merged
lucasfernog merged 2 commits intotauri-apps:devfrom May 9, 2025
Merged
Conversation
Contributor
Package Changes Through e86b770There are 7 changes which include tauri-bundler with patch, tauri with minor, @tauri-apps/api with minor, tauri-cli with patch, @tauri-apps/cli with patch, tauri-runtime-wry with patch, tauri-utils with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
lucasfernog
approved these changes
May 9, 2025
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.
This PR rolls back one of the changes introduced in #13309 that offsets the work area by the visible frame reported by macOS.
I have noticed that on my primary monitor (whether that be internal or external to my laptop) that the visible frame reported by macOS is
(0, 83). This causes the Tauri calculation to report the start position of the work area as being y83when it should be0. If I use the changes in this PR I instead get0which points to the position directly under the macOS top bar as I would have expected.I have left the x offset as it accounts for the size of the dock when it's on the left or the right.
Demo
We use the work area to caculate where to put the window when docking.
Before
On my primary monitor the work_area would report incorrect so the window would get position lower than expected. This would only happen on my primary monitor. It would work correctly on any secondary monitors.
Screen.Recording.2025-05-09.at.8.44.56.am.mov
After
Screen.Recording.2025-05-09.at.8.45.44.am.mov
Screen.Recording.2025-05-09.at.8.46.31.am.mov