Advertise UTF8_STRING mimetype

Certain applications only accept UTF8_STRING mimetype like Geany
even so they are Wayland native.
This commit is contained in:
Kirill Chibisov 2020-08-10 13:25:25 +03:00 • committed by Victor Berger
parent 597086c42c
commit d688c33f23
2 changed files with 6 additions and 3 deletions

View file

@ -3,6 +3,7 @@
## Unreleased ## Unreleased
- Fixed clipboard crashing, when seat has neither keyboard nor pointer focus - Fixed clipboard crashing, when seat has neither keyboard nor pointer focus
- Advertise UTF8_STRING mimetype
## 0.5.1 -- 2020-07-10 ## 0.5.1 -- 2020-07-10

View file

@ -65,12 +65,14 @@ macro_rules! handle_store {
($env:ident, ($env:ident,
$sel_source:ident, $sel_device:ident, $event_ty:ident, $sel_source:ident, $sel_device:ident, $event_ty:ident,
$seat:ident, $serial:ident, $queue:ident, $contents:ident) => { $seat:ident, $serial:ident, $queue:ident, $contents:ident) => {
let data_source = let data_source = $env.$sel_source(
$env.$sel_source(vec![MimeType::TextPlainUtf8.to_string()], move |event, _| { vec![MimeType::TextPlainUtf8.to_string(), MimeType::Utf8String.to_string()],
move |event, _| {
if let $event_ty::Send { mut pipe, .. } = event { if let $event_ty::Send { mut pipe, .. } = event {
write!(pipe, "{}", $contents).unwrap(); write!(pipe, "{}", $contents).unwrap();
} }
}); },
);
let _ = $env.$sel_device(&$seat, |device| { let _ = $env.$sel_device(&$seat, |device| {
device.set_selection(&Some(data_source), $serial); device.set_selection(&Some(data_source), $serial);