Skip to content

Commit 92d0ce6

Browse files
committed
fix copy in macos arm64
1 parent 15202b9 commit 92d0ce6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jsonwebtoken = "9.2.0"
4949
chrono = "0.4"
5050

5151
# XCB is a PITA to compile for ARM so disabling the copy feature on ARM for now
52-
[target.'cfg(target_arch = "x86_64")'.dependencies]
52+
[target.'cfg(any(target_arch = "x86_64", all(target_os = "macos", target_arch = "aarch64")))'.dependencies]
5353
clipboard = "0.5"
5454

5555
[dev-dependencies.cargo-husky]

src/handlers/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ fn handle_block_scroll(app: &mut App, up: bool, is_mouse: bool, page: bool) {
274274
}
275275
}
276276

277-
#[cfg(target_arch = "x86_64")]
277+
#[cfg(any(
278+
target_arch = "x86_64",
279+
all(target_os = "macos", target_arch = "aarch64")
280+
))]
278281
fn copy_to_clipboard(content: String) {
279282
use clipboard::{ClipboardContext, ClipboardProvider};
280283

@@ -284,7 +287,10 @@ fn copy_to_clipboard(content: String) {
284287
.expect("Unable to set content to clipboard");
285288
}
286289

287-
#[cfg(any(target_arch = "aarch64", target_arch = "arm"))]
290+
#[cfg(not(any(
291+
target_arch = "x86_64",
292+
all(target_os = "macos", target_arch = "aarch64")
293+
)))]
288294
fn copy_to_clipboard(_content: String) {
289295
// do nothing as its a PITA to compile for ARM with XCB and this feature is not that important
290296
}

0 commit comments

Comments
 (0)