From 2056e7f40abace4ce48b5171376857e2015e2dfd Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sun, 12 Mar 2023 20:47:52 -0700 Subject: [PATCH] Fix traffic lights thingy --- src-tauri/src/main.rs | 5 +++++ src-tauri/src/window_ext.rs | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 1472bb30..6b60d970 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -352,7 +352,10 @@ fn main() { .system_tray(system_tray) .setup(|app| { let win = app.get_window("main").unwrap(); + + #[cfg(target_os = "macos")] win.position_traffic_lights(); + Ok(()) }) .setup(|app| { @@ -402,6 +405,8 @@ fn main() { .on_window_event(|e| { let apply_offset = || { let win = e.window(); + + #[cfg(target_os = "macos")] win.position_traffic_lights(); }; diff --git a/src-tauri/src/window_ext.rs b/src-tauri/src/window_ext.rs index 3b74cd5f..7a401f83 100644 --- a/src-tauri/src/window_ext.rs +++ b/src-tauri/src/window_ext.rs @@ -4,7 +4,6 @@ const TRAFFIC_LIGHT_OFFSET_X: f64 = 15.0; const TRAFFIC_LIGHT_OFFSET_Y: f64 = 22.0; pub trait WindowExt { - #[cfg(target_os = "macos")] fn position_traffic_lights(&self); }