Skip to content

fix(macOS): caculation for work area#13401

Merged
lucasfernog merged 2 commits intotauri-apps:devfrom
oscartbeaumont:fix-macos-work-area-calc
May 9, 2025
Merged

fix(macOS): caculation for work area#13401
lucasfernog merged 2 commits intotauri-apps:devfrom
oscartbeaumont:fix-macos-work-area-calc

Conversation

@oscartbeaumont
Copy link
Member

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 y 83 when it should be 0. If I use the changes in this PR I instead get 0 which 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

@oscartbeaumont oscartbeaumont requested a review from a team as a code owner May 9, 2025 01:09
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap May 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2025

Package Changes Through e86b770

There 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 Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.5.0 2.6.0
tauri-utils 2.4.0 2.5.0
tauri-bundler 2.4.0 2.4.1
tauri-runtime 2.6.0 2.6.1
tauri-runtime-wry 2.6.0 2.6.1
tauri-codegen 2.2.0 2.2.1
tauri-macros 2.2.0 2.2.1
tauri-plugin 2.2.0 2.2.1
tauri-build 2.2.0 2.2.1
tauri 2.5.1 2.6.0
@tauri-apps/cli 2.5.0 2.5.1
tauri-cli 2.5.0 2.5.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@Legend-Master Legend-Master requested a review from lucasfernog May 9, 2025 01:44
@lucasfernog lucasfernog merged commit bc2f0e4 into tauri-apps:dev May 9, 2025
20 checks passed
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap May 9, 2025
@oscartbeaumont oscartbeaumont deleted the fix-macos-work-area-calc branch May 17, 2025 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In audit

Development

Successfully merging this pull request may close these issues.

2 participants