Skip to content

Commit

Permalink
fix: 修复macos构建失败
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Mar 11, 2023
1 parent c03125d commit 0a5a1c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-wo
once_cell = "1.17.1"
reqwest = "0.11.14"



[target.'cfg(windows)'.dependencies]
window-shadows = "0.2"
windows = {version="0.44.0",features= ["Win32_UI_WindowsAndMessaging", "Win32_Foundation"] }
enigo = {git = "https://github.com/enigo-rs/enigo"}
cli-clipboard = "0.4.0"

[target.'cfg(macos)'.dependencies]
window-shadows = "0.2"

[features]
# by default Tauri runs in production mode
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/src/shortcut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ fn get_mouse_location() -> Result<(i32, i32), String> {
}
// 划词翻译
fn translate() {
#[cfg(target_os = "windows")]
let (x, y) = get_mouse_location().unwrap();
#[cfg(target_os = "linux")]
let (x, y) = get_mouse_location().unwrap();
// 复制操作必须在拉起窗口之前,否则焦点会丢失
#[cfg(target_os = "windows")]
Expand Down

0 comments on commit 0a5a1c2

Please sign in to comment.