patch: fix copy to nautilus
Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
This commit is contained in:
parent
4c792f6f17
commit
ce9c9078e5
@ -31,6 +31,7 @@ pub struct X11Clipboard {
|
|||||||
ignore_path: PathBuf,
|
ignore_path: PathBuf,
|
||||||
text_uri_list: Atom,
|
text_uri_list: Atom,
|
||||||
gnome_copied_files: Atom,
|
gnome_copied_files: Atom,
|
||||||
|
nautilus_clipboard: Atom,
|
||||||
|
|
||||||
former_file_list: Mutex<Vec<PathBuf>>,
|
former_file_list: Mutex<Vec<PathBuf>>,
|
||||||
}
|
}
|
||||||
@ -46,11 +47,16 @@ impl X11Clipboard {
|
|||||||
.setter
|
.setter
|
||||||
.get_atom("x-special/gnome-copied-files")
|
.get_atom("x-special/gnome-copied-files")
|
||||||
.map_err(|_| CliprdrError::CliprdrInit)?;
|
.map_err(|_| CliprdrError::CliprdrInit)?;
|
||||||
|
let nautilus_clipboard = clipboard
|
||||||
|
.setter
|
||||||
|
.get_atom("x-special/nautilus-clipboard")
|
||||||
|
.map_err(|_| CliprdrError::CliprdrInit)?;
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
ignore_path: ignore_path.to_owned(),
|
ignore_path: ignore_path.to_owned(),
|
||||||
stop: AtomicBool::new(false),
|
stop: AtomicBool::new(false),
|
||||||
text_uri_list,
|
text_uri_list,
|
||||||
gnome_copied_files,
|
gnome_copied_files,
|
||||||
|
nautilus_clipboard,
|
||||||
former_file_list: Mutex::new(vec![]),
|
former_file_list: Mutex::new(vec![]),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -102,7 +108,8 @@ impl SysClipboard for X11Clipboard {
|
|||||||
let gnome_copied_files_data = ["copy\n".as_bytes(), uri_list.as_bytes()].concat();
|
let gnome_copied_files_data = ["copy\n".as_bytes(), uri_list.as_bytes()].concat();
|
||||||
let batch = vec![
|
let batch = vec![
|
||||||
(self.text_uri_list, text_uri_list_data),
|
(self.text_uri_list, text_uri_list_data),
|
||||||
(self.gnome_copied_files, gnome_copied_files_data),
|
(self.gnome_copied_files, gnome_copied_files_data.clone()),
|
||||||
|
(self.nautilus_clipboard, gnome_copied_files_data),
|
||||||
];
|
];
|
||||||
self.store_batch(batch)
|
self.store_batch(batch)
|
||||||
.map_err(|_| CliprdrError::ClipboardInternalError)
|
.map_err(|_| CliprdrError::ClipboardInternalError)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user