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
- Fixed clipboard crashing, when seat has neither keyboard nor pointer focus
- Advertise UTF8_STRING mimetype
## 0.5.1 -- 2020-07-10

View file

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