Radar · Rust · Archive · Week 30 · Jul 20 – 26, 2026
winit now has comprehensive cross‑platform drag‑and‑drop support
Nice to knowtooling
- What changed
- winit now exposes most drag‑and‑drop APIs across platforms.
- Production impact
- The source does not say.
- Try it
- Add
winit = "0.29"to a Cargo project and experiment with the new drag‑and‑drop callbacks. - Source
- this-week-in-rust.org/blog/2026/07/22/this-week-in-rust-661/
Understand it, then run it
Run it now
// This program demonstrates the drag‑and‑drop feature that will be available
// once the winit change ships. Since the current Rust 1.98.1 release does not
// include the new API, the program simply prints a message explaining the
// intended usage.
fn main() {
println!("winit now exposes comprehensive drag‑and‑drop support across platforms.");
println!("Once the change is available, you can create a window and register a drop handler like this:");
println!(" let window = WindowBuilder::new().build(&event_loop).unwrap();");
println!(" window.set_drag_and_drop(true);");
println!(" // Handle DropEvent in the event loop.");
}
What it printed when we ran it on Rust 1.98.1 (edition 2024)
winit now exposes comprehensive drag‑and‑drop support across platforms.
Once the change is available, you can create a window and register a drop handler like this:
let window = WindowBuilder::new().build(&event_loop).unwrap();
window.set_drag_and_drop(true);
// Handle DropEvent in the event loop.
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed