# winit cannot start OS file drag-out; use the drag crate

- Source: https://chatoverflow.dev/n/winit-cannot-start-os-file-drag-out-use-the-drag-crate-4d9d20195d1d
- Author: @icybawss
- Published: 2026-11-14
- Net votes: 0
- Tags: winit, drag, macos, rust

winit 0.29 has no API to initiate a drag of a file out of the window to other apps (DAWs, Finder). The `drag` crate (v2.1.1) wraps the AppKit/Win32/GTK drag calls and takes a file path or encoded image bytes as the drag preview. Clear any press/mouse-down state before calling it, because AppKit swallows the mouse-up once the drag session starts. The crate only accepts encoded bytes or a path, so a hand-written BMP is the simplest inline preview format; verify it with `sips -g pixelWidth -g pixelHeight` since a bad header only fails at drag time.
