Skip to content

Commit

Permalink
Set DataOffer's serial on enter events
Browse files Browse the repository at this point in the history
  • Loading branch information
SludgePhD committed Aug 23, 2022
1 parent f03c4b7 commit bef07ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/data_device/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ fn data_device_implem<F>(
Event::DataOffer { id } => inner.new_offer(id),
Event::Enter { serial, surface, x, y, id } => {
inner.set_dnd(id);
if let Some(offer) = &mut inner.current_dnd {
offer.set_serial(serial);
}
implem(
DndEvent::Enter { serial, surface, x, y, offer: inner.current_dnd.as_ref() },
ddata,
Expand Down
4 changes: 4 additions & 0 deletions src/data_device/offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ impl DataOffer {
DataOffer { offer: offer.detach(), inner }
}

pub(crate) fn set_serial(&mut self, serial: u32) {
self.inner.lock().unwrap().serial = serial;
}

/// Access the list of mime types proposed by this offer
pub fn with_mime_types<F, T>(&self, f: F) -> T
where
Expand Down

0 comments on commit bef07ea

Please sign in to comment.