Skip to content

data-device: preserve dropped offers when another drag enters - #546

Open
mockydevs wants to merge 1 commit into
Smithay:masterfrom
mockydevs:fix/preserve-dropped-offers
Open

mockydevs wants to merge 1 commit into
Smithay:masterfrom
mockydevs:fix/preserve-dropped-offers

Conversation

@mockydevs

Copy link
Copy Markdown

When a second drag enters while the client is still reading a previous dropped offer, the Enter handler destroys that previous offer. This prevents the client from finishing it after the asynchronous read. The Leave handler already preserves dropped offers and documents that the client owns their final cleanup.

Reuse DataOfferData::leave() when replacing the previous offer. Hover-only offers are still destroyed; dropped offers remain available for the client to finish and destroy. This also records that the old drag has left.

Validation on Linux:

  • cargo fmt --all -- --check
  • cargo check --no-default-features
  • cargo test --no-default-features --lib and --doc
  • cargo test --all-features
  • cargo clippy -- -D warnings

A local isolated Wayland-server regression delays the first transfer, then sends another Enter/Drop before that read completes. With a winit 0.31 client retaining both sessions, the original SCTK code produces only one finish request; this change produces both finish requests and delivers all three test paths. The protocol harness is local validation, not a new test committed in this PR. No application-specific behavior or dependencies are added.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant