Note: I'm happy to implement this and come back with a PR if y'all think it's a good addition!
Is your feature request related to a problem? Please describe.
I'm building a file manager on macOS with Tauri 2 + wry. When the user drags files to my app, I wanna show my cool dynamic in-app overlay (icons, target folder name, etc.). But I only want to do this when the source app's drag img is tiny/blank. When the source provides a rich preview (like Finder's), I need to hide mine to avoid the two clashing.
My problem is that DragDropEvent::Enter only gives me paths and position. There's no way to know anything about the incoming drag image, so I can't make that decision.
Describe the solution you'd like
Add an optional image_size: Option<(f64, f64)> (or similar) to DragDropEvent::Enter on macOS, populated from the union of NSDraggingItem.draggingFrame rects via enumerateDraggingItems. On other platforms it could just be None until there's a way to get it.
Describe alternatives you've considered
NSDraggingInfo.draggedImage(): Deprecated, returns nil for cross-process drags since macOS 10.12.
- Method swizzling on WryWebView: I could swizzle
draggingEntered: to intercept the NSDraggingInfo and read the frame size myself. This works but it feels fragile/meh.
- Always show / always hide the overlay: Well, if I show it then the two overlays overlap and look like crap. If I hide mine, that solves it but then I can't show my cool custom content.
Additional context
I'm happy to implement this and come back with a PR! Wanted to check first if this sounds reasonable, and if you have preferences on the API shape. For example, whether it should be a separate struct, just a tuple, or a broader "drag source metadata" field for future extensibility.
Note: I'm happy to implement this and come back with a PR if y'all think it's a good addition!
Is your feature request related to a problem? Please describe.
I'm building a file manager on macOS with Tauri 2 + wry. When the user drags files to my app, I wanna show my cool dynamic in-app overlay (icons, target folder name, etc.). But I only want to do this when the source app's drag img is tiny/blank. When the source provides a rich preview (like Finder's), I need to hide mine to avoid the two clashing.
My problem is that
DragDropEvent::Enteronly gives mepathsandposition. There's no way to know anything about the incoming drag image, so I can't make that decision.Describe the solution you'd like
Add an optional
image_size: Option<(f64, f64)>(or similar) toDragDropEvent::Enteron macOS, populated from the union ofNSDraggingItem.draggingFramerects viaenumerateDraggingItems. On other platforms it could just beNoneuntil there's a way to get it.Describe alternatives you've considered
NSDraggingInfo.draggedImage(): Deprecated, returnsnilfor cross-process drags since macOS 10.12.draggingEntered:to intercept theNSDraggingInfoand read the frame size myself. This works but it feels fragile/meh.Additional context
I'm happy to implement this and come back with a PR! Wanted to check first if this sounds reasonable, and if you have preferences on the API shape. For example, whether it should be a separate struct, just a tuple, or a broader "drag source metadata" field for future extensibility.