Skip to content

Commit

Permalink
fix(winit): cleanup layer surface dnd surface
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Dec 3, 2024
1 parent 7f48522 commit c4eaf6a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions winit/src/platform_specific/wayland/sctk_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,16 +666,14 @@ impl SctkEvent {
LayerSurfaceEventVariant::Done => {
if let Some(id) = surface_ids.remove(&surface.id()) {
if let Some(w) = window_manager.remove(id.inner()) {
clipboard.register_dnd_destination(
DndSurface(Arc::new(Box::new(w.raw.clone()))),
Vec::new(),
);
if clipboard
.window_id()
.is_some_and(|id| w.raw.id() == id)
{
clipboard.register_dnd_destination(
DndSurface(Arc::new(Box::new(
w.raw.clone(),
))),
Vec::new(),
);
*clipboard = Clipboard::unconnected();
}
}
Expand Down

0 comments on commit c4eaf6a

Please sign in to comment.