-
Notifications
You must be signed in to change notification settings - Fork 921
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
Support drag and drop on wayland #1881
Comments
Can we use https://github.com/Smithay/wayland-rs i.e. wayland-client for implementation? Smithay's wayland client toolkit builds on top of it, so it should be a seamless integration. The |
The |
@WhyNotHugo gnome breaks if you bind multiple data devices(it'll use only one of them), so unless winit has clipboard adding drag and drop is not possible. |
Upon further inspection (I was trying to use DataDevice directly in my application) it seems that it's been dropped in sctk-master anyway, so it's best not to rely on it.
I'm not sure what the correct behaviour is when binding to a global twice, but I'm pretty sure it's not something that should be done anyway.
|
If something is missing is stck master, it's only because it wasn't ported yet. SCTK had abstractions for dnd and clipboard(it's the same thing) for a long time. We have a PR adding DND already for Wayland, it just breaks clipboard on gnome, because gnome doesn't allow client to bind multiple times to data device. |
Data device support is specifically one of the blockers for the next release of sctk. There's a PR for it: Smithay/client-toolkit#301
Good question. Maybe the Wayland protocol spec could use some clarification on this? Normally binding something multiple times is perfectly fine and works correctly (and may be needed when multiple libraries are making Wayland calls), so without text in the spec about this the Gnome behavior sounds incorrect. |
That works fine on sway for example, it just gnome is special and doesn't bother to fix anything. I bet it still sends |
Ah, thanks for pointing out the new DataDevice implementation in sctk, I'd missed it. This seems to bind the data device global only once for both clipboard and drag-and-drop, so should be usable here, right? Looks like the GNOME bug was fixed: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1253 https://gitlab.gnome.org/GNOME/mutter/-/commit/7e4e3714663952a69ba0a26662841fc5c0cb266c |
I believe the issue is that winit doesn't currently provide clipboard support (#2156). It looks like toolkits and such in Rust are currently mostly using So I guess to fix it on the version of Mutter with this issue, it would be necessary to also add clipboard support to winit, and then software updating to the new version of winit would need to update their clipboard support to use winit's implementation. Which for the most part is probably how it should be done anyway. Though maybe not an issue if it was fixed in Gnome a couple years ago? Not sure what release it made it into of if it was backported. Or if this is any issue in any other compositor. |
GitLab indicates that the fix made it to the |
Okay, so that should be on Ubuntu 20.04 (the previous LTS) and the like. That sounds like it should generally cover current Gnome users that are using Wayland. |
Any updates regarding this? Or better said, is there any blocking instance left? |
After #3367. |
Drag and drop window events are currently not supported on wayland.
I wonder how it is possible to implement it considering smithay-client-toolkit contains some helper for it: DataDevice.
The text was updated successfully, but these errors were encountered: