-
Notifications
You must be signed in to change notification settings - Fork 166
Xwayland DnD support #1797
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
Xwayland DnD support #1797
Conversation
07af2d3 to
a77ddf6
Compare
|
Rebased and ready for initial Q/A |
a77ddf6 to
f643024
Compare
|
This is finally ready for review! |
jacobgkau
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.
This gets drag-and-drop working to Xwayland apps and between Xwayland apps. (The Slack flatpak still has its own problems with reporting all file extensions as unsupported, similar to its copy/paste behavior, but the Discord flatpak and Chrome launched with its Ozone platform forced both work for testing.)
It does seem like drag-and-drop from Xwayland to Wayland isn't working, or at least I haven't found any scenarios where it works yet. When I launch Chrome under Wayland (default), I can drag an image from it into LibreOffice Writer, but when I launch Chrome with its Ozone platform forced to X11, the same image doesn't get put into LibreOffice Writer when I try to drop it there. Are things like that supposed to work?
(Note that drag&drop between Xwayland apps was likely working fine before and doesn't need any special support from us. This purely concerns DnD between a Wayland and an Xwayland application. Though both DnD between Xwayland and between Wayland apps should be regression tested.)
Yes they are. I tested previously and this morning again, that I can drag&drop files both ways between cosmic-files and nautilus launched with I am investigating the chrome bug, as that likely also affects a bunch of electron apps. |
|
Found the issue with chromium-based apps: Smithay/smithay#1864 Waiting for smithay review and merge |
f643024 to
e97d42d
Compare
|
Rebased with new smithay changes to fix chromium-based apps. |
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.
After dragging an image from X11 Chrome into LibreOffice Writer, there's a delay before the cursor stops showing the preview of what I dropped:
2025-12-01.10-51-17.mp4
Also, after dropping that same image into LibreOffice a few times, I see it stop working and Chrome stops responding to mouse input. (I've recreated this multiple times.) Just before this happens, the drag preview shows up in the corner or side of the screen instead of where the mouse cursor is.
|
Looks like the issue with Chrome no longer responding to mouse input might be triggered specifically by dropping the image onto an existing image in LibreOffice Writer (rather than into an empty space in the document). |
Fixes for this and the stuck dnd preview are send to upstream here: Smithay/smithay#1867 Will update the PR as soon as it is merged. |
e97d42d to
ac9b307
Compare
|
Pushed fix |
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.
Writer's now crashing when I highlight text and try to drag it into X11 Chrome, as soon as the cursor gets to the Chrome window.
2025-12-03.12-56-07.mp4
(I'm also having trouble typing in Writer after dropping an image wider than the page size into it, but that doesn't seem to be specific to Xwayland or this branch of cosmic-comp, so it's not a regression and doesn't need to be addressed now.)
|
I am slowly starting to loose my mind over this PR, but I found this bug as well: Smithay/smithay#1868 PR update pending as usual. |
ac9b307 to
65e08a6
Compare
|
Fixed. Tested various dnd interactions between cosmic-files (wayland), nautilus (X11), google-chrome (ozone X11) and libreoffice writer (wayland) and could not find any more crashes or regressions. |
jacobgkau
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.
I'm still very occasionally seeing the drag preview pop up in the bottom-left corner of the screen for a moment after I drop it. I caught it in a screencast here, on the second drop of the image:
xdnd-preview-corner.mp4
At this point, the functionality outweighs the tiny visual glitch, so I'm going ahead and approving. I'll plan to open an issue to track this if you don't address it here.
Please do, since it might be a bit until I find the time to figure this one out. The preview image from X11-clients is done and controlled by the X11 clients themselves. So potentially there is nothing to be done here by us, but if this happens less frequently on other desktops, I would want to at least look into it. |
Draft on top of #1726 to play around with Smithay/smithay#1848