linux: Primary clipboard (#10534)
Implements copying from and pasting to the primary selection. Release Notes: - N/A
This commit is contained in:
@@ -692,6 +692,8 @@ impl Platform for WindowsPlatform {
|
||||
false
|
||||
}
|
||||
|
||||
fn write_to_primary(&self, _item: ClipboardItem) {}
|
||||
|
||||
fn write_to_clipboard(&self, item: ClipboardItem) {
|
||||
if item.text.len() > 0 {
|
||||
let mut ctx = ClipboardContext::new().unwrap();
|
||||
@@ -699,6 +701,10 @@ impl Platform for WindowsPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
fn read_from_primary(&self) -> Option<ClipboardItem> {
|
||||
None
|
||||
}
|
||||
|
||||
fn read_from_clipboard(&self) -> Option<ClipboardItem> {
|
||||
let mut ctx = ClipboardContext::new().unwrap();
|
||||
let content = ctx.get_contents().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user