Skip to content

Commit

Permalink
fix(macos): fix position of the tray icon to top-left (#149)
Browse files Browse the repository at this point in the history
* fix(macos): fix position of the tray icon to top-left

* Update .changes/fix-macos-tray-item-y-pos.md

---------

Co-authored-by: Amr Bashir <[email protected]>
  • Loading branch information
pewsheen and amrbashir authored Apr 30, 2024
1 parent 599bb8f commit 6d099ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-macos-tray-item-y-pos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tray-icon": patch
---

On macOS, fix the `y` position of the tray icon to be top-left not bottom-left of the icon.
2 changes: 1 addition & 1 deletion src/platform_impl/macos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ fn get_tray_rect(window: id) -> Rect {
.to_physical(scale_factor),
position: crate::dpi::LogicalPosition::new(
frame.origin.x,
flip_window_screen_coordinates(frame.origin.y),
flip_window_screen_coordinates(frame.origin.y) - frame.size.height,
)
.to_physical(scale_factor),
}
Expand Down

0 comments on commit 6d099ee

Please sign in to comment.