#![cfg_attr( all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows" )] #[cfg(target_os = "macos")] #[macro_use] extern crate objc; mod commands; mod runtime; mod window_ext; use tauri::{Manager, WindowEvent}; use window_ext::WindowExt; fn main() { tauri::Builder::default() .setup(|app| { let win = app.get_window("main").unwrap(); win.position_traffic_lights(); Ok(()) }) .on_window_event(|e| { let apply_offset = || { let win = e.window(); win.position_traffic_lights(); }; match e.event() { WindowEvent::Resized(..) => apply_offset(), WindowEvent::ThemeChanged(..) => apply_offset(), _ => {} } }) .invoke_handler(tauri::generate_handler![ commands::send_request, commands::greet ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); }