fix: remove a destination surface if it is assigned empty list of rectangles

This commit is contained in:
Ashley Wulber 2024-05-01 11:52:12 -04:00
parent 2263426a09
commit eefa50c3df
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820

View file

@ -254,7 +254,11 @@ where
match r {
DndRequest::InitDnd(sender) => self.dnd_state.sender = Some(sender),
DndRequest::Surface(s, dests) => {
self.dnd_state.destinations.insert(s.surface.id(), (s, dests));
if dests.is_empty() {
self.dnd_state.destinations.remove(&s.surface.id());
} else {
self.dnd_state.destinations.insert(s.surface.id(), (s, dests));
}
},
DndRequest::StartDnd { internal, source, icon, content, actions } => {
_ = self.start_dnd(internal, source, icon, content, actions);