fix(macOS): correct value for work_area.position.y#14655
Conversation
Package Changes Through 99defe0There are 12 changes which include tauri with minor, @tauri-apps/api with minor, tauri-macros with minor, tauri-build with minor, tauri-macos-sign with patch, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-cli with minor, tauri-runtime with minor, tauri-runtime-wry with minor, tauri-utils with minor, tauri-plugin 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 |
|
Showing support for this, it does fix an issue in Handy |
|
unfortunately i do not have permission to push :( |
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
Lgtm! |
|
@jbaudanza can you also push a change file? .changes/work-area.md ---
"tauri": patch:bug
"tauri-runtime-wry": patch:bug
---
Fix monitor work area Y position on macOS. |
|
Currently, the value of
work_area.position.yis returning 0. On a screen with a menubar, this should be something like 38. This makes it difficult to position windows at the top of the screen correctly.This calculation was originally set in #13309, however the math seems incorrect.
This calculation was removed in #13401, which set the value back to 0.
You can set the window position to 0, and it seems the system will (usually, not always) move the window below the menu bar. However, it would be better if I can just directly move the window to where it should be (y=38).
The PR attempts to correct the calculation for
position.y. It takes into account the bottom-up coordinate system used byvisible_frame. It should work correctly regardless of the menu bar size and presence.