Add support for primary clipboard

This commit is contained in:
Mattias Eriksson 2024-02-07 17:25:40 +01:00 committed by Héctor Ramón Jiménez
parent 7615b2240c
commit 4155edab8d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
7 changed files with 96 additions and 1 deletions

View file

@ -715,6 +715,18 @@ pub fn run_command<A, C, E>(
clipboard.write(contents);
}
},
command::Action::ClipboardPrimary(action) => match action {
clipboard::Action::Read(tag) => {
let message = tag(clipboard.read_primary());
proxy
.send_event(message)
.expect("Send message to event loop");
}
clipboard::Action::Write(contents) => {
clipboard.write_primary(contents);
}
},
command::Action::Window(action) => match action {
window::Action::Close(_id) => {
*should_exit = true;