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

Please support making native app window a drag & drop target #2

Open
technolion opened this issue Dec 3, 2020 · 6 comments
Open

Please support making native app window a drag & drop target #2

technolion opened this issue Dec 3, 2020 · 6 comments
Labels
enhancement New feature or request work in progress This is currently being implemented

Comments

@technolion
Copy link
Contributor

It would be great if bitsdojo_window is being extended in a way that Drag & Drop operations to the native window are accessible in the Dart code of the flutter app.
This would allow for dropping files onto a Flutter app which could then be processed with Dart!

@bitsdojo
Copy link
Owner

bitsdojo commented Dec 3, 2020

This has been on my mind for some time and I will definitely look into it!

@bitsdojo bitsdojo added the enhancement New feature or request label Dec 4, 2020
@technolion
Copy link
Contributor Author

I got Drag & Dropping to work on Windows by modifying FlutterWindow:
https://codereview.stackexchange.com/questions/253264/make-flutter-app-on-windows-a-drop-target-to-accept-files

But I am unsure whether this can be used in a plugin. Maybe it helps though.

@bitsdojo
Copy link
Owner

bitsdojo commented Dec 11, 2020

Hi Thomas,

Thank you for sharing!

It is a good start and there are only a couple of things I would change about that implementation. For example, the QueryInterface should return an object in ppvObject when returning S_OK and that should only happen for IID_IUnknown, IID_IDropTarget and maybe IDropSource as well.

Normally QueryInterface would also call AddRef and AddRef/Release would increment/decrement some sort of a private counter and delete the object when that counter comes to zero but I would leave those empty in your sample as we probably don't want to free the FlutterWindow object by ourselves.

I will implement it in the package as soon as I finish the macOS support (next days).

To answer your question: yes, this can be done in the plugin, it is just a matter of time.

Thank you for the reminder!

@bitsdojo bitsdojo added the work in progress This is currently being implemented label Dec 11, 2020
@esDotDev
Copy link
Contributor

esDotDev commented Jan 20, 2021

Hey there, just curious where you are at with this? We're currently working on a couple of PR's, one to add Linux support. Wondering if this is worth looking into, or if you are well underway here? Maybe we can divy up the work? We're shooting for some end of February deadline for our desktop app.

@john-rager
Copy link

@bitsdojo - great package, but has there been any progress on this issue? DnD is a key feature for my app and I'd like to use bitsdojo_window, but lacking built-in DnD support I've tried unsuccessfully to use the package along with the desktop_drop package and they appear to conflict in some way. No error, but I don't get a working drop target (just the red 'no entry" icon).

Any status or thoughts on workaround? I see the @technolion solution above, but would rather not mess with the generated code if possible. Thanks!

@john-rager
Copy link

@bitsdojo - my sincere apologies: the package does appear to be working fine with desktop_drop. I had been doing a lot of editing and hot-reloading, and must've gotten my state all out of sorts. With a fresh build-run, it's working fine. For those seeking a solution for DnD with bitsdojo_window, I think this combination works well as we can easily define a specific target widget for finer control. Thanks again for the work on this useful package.

jjoelj added a commit to BlueBubblesApp/bitsdojo_window that referenced this issue Jan 23, 2023
JanezStupar pushed a commit to JanezStupar/bitsdojo_window that referenced this issue Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work in progress This is currently being implemented
Projects
None yet
Development

No branches or pull requests

4 participants