refactor: Allow requesting a specific mime type when peeking at the offer
This commit is contained in:
parent
1b6efd066e
commit
efe7a75e7b
2 changed files with 12 additions and 7 deletions
|
|
@ -88,9 +88,9 @@ fn main() {
|
|||
smithay_clipboard::dnd::DndEvent::Offer(id, OfferEvent::Motion { x, y }) => {
|
||||
if id != state.offer_hover_id {
|
||||
state.offer_hover_id = id;
|
||||
if let Ok(data) = state.clipboard.peek_offer::<smithay_clipboard::text::Text>(
|
||||
MimeType::Text(smithay_clipboard::mime::Text::TextPlain),
|
||||
) {
|
||||
if let Ok(data) =
|
||||
state.clipboard.peek_offer::<smithay_clipboard::text::Text>(None)
|
||||
{
|
||||
println!("Peeked the data: {}", data.0);
|
||||
}
|
||||
}
|
||||
|
|
@ -117,8 +117,9 @@ fn main() {
|
|||
println!("Received DnD Enter for {id:?}");
|
||||
state.offer_hover_id = id;
|
||||
if let Some(mime) = mime_types.get(0) {
|
||||
if let Ok(data) =
|
||||
state.clipboard.peek_offer::<smithay_clipboard::text::Text>(mime.clone())
|
||||
if let Ok(data) = state
|
||||
.clipboard
|
||||
.peek_offer::<smithay_clipboard::text::Text>(Some(mime.clone()))
|
||||
{
|
||||
println!("Peeked the data: {}", data.0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue