Support for file dragging
winit already has (albeit rudimentary) support for dropping files onto a window, but no way to allow dragging data from a window. As it already supports dropping, I think dragging should also be supported by winit. Being able to drag a file from a winit window is the last missing piece for my usecase of the library.
Hey I would like this as a feature as well.
Hey I would like this as a feature as well.
If you're interested in getting the ball rolling on this, then I'd suggest that you look into what APIs we need to use on each platform, and perhaps formulate why this functionality must exist in winit beyond "winit already supports dropping", as neither SDL2 nor GLFW support this (to my knowledge).
Hey I would like this as a feature as well.
If you're interested in getting the ball rolling on this, then I'd suggest that you look into what APIs we need to use on each platform, and perhaps formulate why this functionality must exist in winit beyond "winit already supports dropping", as neither SDL2 nor GLFW support this (to my knowledge).
Right, I have a small bit of knowledge on how this works in the windows api though I've never done it successfully in rust. I may try making a fork of winit and implementing it in my own time, probably when I will want to implement it in my own program (soon I hope).
winit already has (albeit rudimentary) support for dropping files onto a window,
Drop, yes, but DroppedFile and HoveredFile do not report the window-local coordinates and last time I tested cursor locations were not reported while dragging, so it is incomplete.
@dhardy If it helps to know, the cursor coordinates are reported as a CursorMoved event directly after the DroppedFile event is fired. But at one point I was about to go on here and ask if the coordinates could be passed along with DroppedFile so I understand.
Looks like the windows crate is finally figuring out COM objects so I might try to add this soon. But where in winit's source is the best place to put a function that initiates a file drag?
are there any updates regarding this topic?
Any news on this feature?
This is now possible in the current state of the windows API for rust. For anyone interested, you are probably best to get the raw window handle from a winit window and use that with the windows API. You will have to manage OLE/COM properly though I believe or your winit event loop might break.