-
Notifications
You must be signed in to change notification settings - Fork 223
Wayland<->X11 Drag&Drop transfers #1848
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
Conversation
510e69f to
ee949b1
Compare
167e32a to
6decc25
Compare
|
Rebased onto #1854 |
7c6283b to
65d32dd
Compare
|
Okay, all bugs should be squashed now, including:
|
|
When I try to test drag and drop on |
Yes, anvil is not handling moving X11 windows correctly. This PR makes no attempt to fix that, but behaves correctly, if you don't move the window after spawn. |
5e6ec7b to
f938371
Compare
cmeissl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so first round was more technical and not so much functionality.
Will try to give it a second look concentrating on dnd functionality tomorrow.
|
Trying to update niri to this PR. Some things I've hit:
|
I don't think it makes any difference, as the
I changed the function a bit to get rid of the generic argument altogether. :) |
YaLTeR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test niri update: YaLTeR/niri@8ae9590
Some more things I've noticed:
-
After a DnD of a piece of text inside gtk4-demo, the window seemingly stops receiving pointer events until I unfocus and focus it again.
-
In a bunch of places in niri, I test if the grab is a DnD grab, i.e.:
let is_dnd_grab = grab.as_any().is::<DnDGrab<Self>>();
With the addition of new generic parameters, it becomes somewhat unwieldy, especially that
S: Sourceparameter that can be several different things (at leastWlSurfaceandWlDataSource).
I don't think it makes any difference, as the
DnDGrabwill continue to send events to the target that started the implicit grab, that was validated for the request. As far as I understand the wayland protocol that is expected and for Xwayland it is necessary for correct behaviour. So the enum-value doesn't really do anything. I changed everything toFocus::Keepthough for consistency.
Thanks.
Actually, apparently I'm checking for pointer focus = None as a condition for triggering the niri hot corner. Previously, during DnD pointer focus was None, but with this PR, pointer focus isn't None during DnD, regardless if I set Focus::Clear or Focus::Keep when creating the DnDGrab. I can add a separate check for this so it's not a big deal, just a behavior change to be noted.
I changed the function a bit to get rid of the generic argument altogether. :)
Thanks, that works better.
Looking at this in more detail, it seems that GTK is unsetting pointer focus on Which leaves us a bit at a conundrum, because ideally it seems like we don't want to set the focus. However Xwayland needs the focus for the grabbing application to generate the necessary dnd-events. Sooo... I added a hack in eb301e5 to force a re-enter on unset. I am not happy with this and suggestions are welcome.
Yeah, I am not sure, what would be a good way of solving this. Even with Xwayland not being deployed, what previously was the Any suggestions on how to improve this are welcome. |
eb301e5 to
0224640
Compare
cmeissl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good from my side, but I would prefer to wait for feedback from @YaLTeR in this case for the final go.
266039e to
cad4c70
Compare
cad4c70 to
0d57d1d
Compare
WIP branch implementing drag&drop between wayland surfaces and xwayland surfaces.
Currently only dragging from wayland -> xwayland works, dnd exclusively between wayland surfaces or xwayland surfaces should not be impacted.
This goes away with the
ServerDndGrab, which would've potentially allowed dropping from Xwayland->Wayland but not vise-versa. Instead it moves part of the DnD-code and most importantly theDnDGrabintocrate::input::dndand abstracts over bothSources and potential targets with the newDndFocus-trait. It needs to be implemented forSeat::PointerFocusif one wants to use theDnDGrab.In theory the new
Source-trait should allow to fully replace theServerDndGrab(if that is even used by any downstream compositor), but I haven't tried that so far, as I have yet to write an implementation of that for Xwayland and not only the wayland-types. (Which is also why this is still a draft.)However the
DnDFocus-trait seems to work out as intended and I would love some feedback on the api design.This still needs more validation, that it doesn't break clients using older wl_data_device versions and works with clients using older XDND versions than 5.