Skip to content

Commit

Permalink
fix: fix wrong macOS trait implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Jun 14, 2022
1 parent a41c2d6 commit f42c1be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-macos-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

Fix macOS `SystemTrayExtMacOS` implementation.
2 changes: 1 addition & 1 deletion src/platform/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ impl SystemTrayExtMacOS for SystemTray {
self.0.icon_is_template = is_template
}

fn set_menu_on_left_click(&mut self, enable: bool) {
fn enable_menu_on_left_click(&mut self, enable: bool) {
self.0.menu_on_left_click = enable
}
}
2 changes: 1 addition & 1 deletion src/platform_impl/macos/system_tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ extern "C" fn perform_tray_click(this: &mut Object, _: Sel, button: id) {
if *menu != nil {
let menu_on_left_click = this.get_ivar::<bool>("menu_on_left_click");
if click_event == TrayEvent::RightClick
|| (menu_on_left_click && click_event == TrayEvent::LeftClick)
|| (*menu_on_left_click && click_event == TrayEvent::LeftClick)
{
let status_bar = this.get_ivar::<id>("status_bar");
status_bar.setMenu_(*menu);
Expand Down

0 comments on commit f42c1be

Please sign in to comment.