-
Notifications
You must be signed in to change notification settings - Fork 928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drag&Drop API / HoveredFile, DroppedFile #1550
Comments
I just spend 2 days trying to figure out why my application thinks I dropped the file at a different location than where my mouse pointer is when I drop the file (when I release the mouse button). It turned out that it's because winit doesn't send any Ideally, winit should send Can you please fix this? :) My use case: |
This is a major issue, I can't even think of many usecases where it would help to just have an event for "dragged a file over the window", unless the file can only be put into exactly one place. Also see #720 (comment) |
Unfortunately hitting this as well. I'm working on a scene editor. When dropping a model into the scene, I need to show where it's going to land. This is currently impossible since Winit doesn't communicate the cursor position to me during the drag :( |
This is similar to #883 and I believe we should also just add mouse position to this event instead of emitting a |
I also need the mouse position of dropped files and ideally while moving. I think emitting |
Adding myself to the list of people who needs this API. Trying to implement drag-and-drop functionality in an egui app on top of winit and ran headfirst into this issue. Are there certain platforms for which this is not possible, or is this an artificial API limitation? |
This API is too limited in my opinion. In general, one needs at least a coordinate relative to the window and to receive updates when this coordinate changes. In my tests on X11, the app does not receive usual cursor or touch events when a file is hovered, hence the window has no way of determining the current coordinate.
Suggestion: add a "source" parameter to
DroppedFile
,HoveredFile
, andHoveredFileCancelled
, and continue to deliver cursor and touch events as normal.Alternatively, include a coordinate and add a
HoveredFileMoved
event.(I have not investigated platform capabilities and don't have a direct use, but wish to add support to KAS, which must determine the widget under the drop.)
The text was updated successfully, but these errors were encountered: