Skip to content
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

File Drag & Drop Support? #80

Open
hyunh90 opened this issue Oct 15, 2019 · 10 comments
Open

File Drag & Drop Support? #80

hyunh90 opened this issue Oct 15, 2019 · 10 comments
Labels
enhancement New feature or request

Comments

@hyunh90
Copy link

hyunh90 commented Oct 15, 2019

I am using this crate via neutrino for a Windows-specific desktop app and in need of file drag & drop support.
I don't know much about WinAPI stuff, but looked some things up: can it be as easy as implementing UI_GetDropTarget() function?

@hyunh90

This comment has been minimized.

@hyunh90 hyunh90 changed the title Future plans? File Drag & Drop Support? Oct 15, 2019
@richardhozak
Copy link
Collaborator

richardhozak commented Oct 15, 2019

Hi, it would definitely need to be implemented in all three platforms we support. I've considered that maybe we could switch to winit for windowing, so we do not have to maintain separate windowing code but even winit does not have drag & drop implemented (see rust-windowing/winit#720). It will probably be difficult to get right for all the platforms, but maybe we can start with Windows as a prototype first?

EDIT: Oh, it seems that winit has some basic drop file support.

@richardhozak richardhozak added the enhancement New feature or request label Oct 15, 2019
@hyunh90
Copy link
Author

hyunh90 commented Oct 15, 2019

I cannot promise anything, but I can definitely start poking OLE API around for drag & drop support. (Maybe we can even use com-rs for this?)

@richardhozak
Copy link
Collaborator

Is there any advantage in using com-rs instead of using winapi-rs directly? But sure, use whatever you want, write it in Rust, write it in C, whatever suits you, we can iterate on that after we've got something working :).

@richardhozak
Copy link
Collaborator

I investigated more and we would most certainly need to use com-rs because winapi-rs does not have the required interfaces implemented, there are PRs to add many remaining interfaces we need such as IOleObject, but if we use com-rs we can define them ourselves, instead of waiting for them to be merged into winapi-rs (they sit there for quite some time).

@PfisterFactor
Copy link

Has there been any progress on this issue? Or perhaps a workaround for a MacOS platform?

@FreeMasen
Copy link
Contributor

What is the advantage of implementing this in webview instead of pointing users to the js api designed to handle this?

https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop

@PfisterFactor
Copy link

@FreeMasen I was under the impression that the javascript drag and drop api does not give you the full path name of the file and needs to be implemented in webview. see the issue in the webview repository.

@FreeMasen
Copy link
Contributor

That is correct you cannot get the true file path, however you can get the bytes and the file name which could be passed through the existing eventing system.

@PfisterFactor
Copy link

My application needs to listen for file system events on the file dragged into the application, so direct access to the full path is needed. So I still think that this would be a useful feature to implement within Webview rather than just the JavaScript api. There might be some way to implement file system notifications within JavaScript, but it seems a hacky workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants