Skip to content

Commit

Permalink
feat: 原生支持Wayland取词
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed May 22, 2023
1 parent 64f4e27 commit 55c3bd1
Show file tree
Hide file tree
Showing 8 changed files with 284 additions and 88 deletions.
163 changes: 163 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Expand Up @@ -39,7 +39,7 @@ arboard = "3.2.0"
[target.'cfg(target_os = "linux")'.dependencies ]
mouse_position = "0.1.3"
x11-clipboard = "0.7.1"
# wl-clipboard-rs = "0.7.0"
wl-clipboard-rs = "0.7.0"

[features]
# by default Tauri runs in production mode
Expand Down
5 changes: 2 additions & 3 deletions src-tauri/src/main.rs
Expand Up @@ -30,8 +30,6 @@ pub static APP: OnceCell<AppHandle> = OnceCell::new();
pub struct StringWrapper(pub Mutex<String>);

fn main() {
#[cfg(target_os = "linux")]
std::env::set_var("GDK_BACKEND", "x11");
tauri::Builder::default()
// 单例运行
.plugin(tauri_plugin_single_instance::init(|app, argv, cwd| {
Expand Down Expand Up @@ -172,7 +170,8 @@ fn main() {
write_config,
set_proxy,
is_macos,
is_linux
is_linux,
is_wayland,
])
//绑定托盘事件
.on_system_tray_event(|app, event| match event {
Expand Down

0 comments on commit 55c3bd1

Please sign in to comment.