mirror of
https://github.com/icewind1991/clipboard-sync
synced 2026-06-03 18:34:07 +02:00
dont sync empty clipboard
This commit is contained in:
parent
57bef593af
commit
4286609e9f
1 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ fn handle_command(
|
||||||
) {
|
) {
|
||||||
if let ClipboardCommand::Set { value, .. } = command {
|
if let ClipboardCommand::Set { value, .. } = command {
|
||||||
let mut clip = current_clipboard.lock().unwrap();
|
let mut clip = current_clipboard.lock().unwrap();
|
||||||
if *clip != value {
|
if *clip != value && value != "" {
|
||||||
let _ = ctx.set_contents(value.clone());
|
let _ = ctx.set_contents(value.clone());
|
||||||
*clip = value;
|
*clip = value;
|
||||||
}
|
}
|
||||||
|
|
@ -83,7 +83,7 @@ fn clipboard_thread(
|
||||||
thread::sleep(HUNDRED_MS);
|
thread::sleep(HUNDRED_MS);
|
||||||
let new_clipboard = ctx.get_contents().unwrap_or_default();
|
let new_clipboard = ctx.get_contents().unwrap_or_default();
|
||||||
let mut clip = current_clipboard.lock().unwrap();
|
let mut clip = current_clipboard.lock().unwrap();
|
||||||
if *clip != new_clipboard {
|
if *clip != new_clipboard && new_clipboard != "" {
|
||||||
send_to_server(
|
send_to_server(
|
||||||
&out,
|
&out,
|
||||||
&ClipboardCommand::Set {
|
&ClipboardCommand::Set {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue