Skip to content

Conversation

@Drakulix
Copy link
Member

Draft on top of #1726 to play around with Smithay/smithay#1848

@Drakulix Drakulix force-pushed the smithay-dnd-update_noble branch 4 times, most recently from 07af2d3 to a77ddf6 Compare November 14, 2025 11:54
@Drakulix
Copy link
Member Author

Rebased and ready for initial Q/A

@Drakulix Drakulix requested a review from a team November 14, 2025 11:55
@Drakulix Drakulix force-pushed the smithay-dnd-update_noble branch from a77ddf6 to f643024 Compare November 25, 2025 16:32
@Drakulix Drakulix marked this pull request as ready for review November 25, 2025 16:33
@Drakulix Drakulix requested a review from a team November 25, 2025 16:33
@Drakulix
Copy link
Member Author

This is finally ready for review!

@Drakulix Drakulix changed the title DnD update Xwayland DnD support Nov 25, 2025
ids1024
ids1024 previously approved these changes Nov 25, 2025
Copy link
Member

@jacobgkau jacobgkau left a 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?

@Drakulix
Copy link
Member Author

This gets drag-and-drop working to Xwayland apps and between Xwayland apps.

(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.)

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?

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 GDK_BACKEND=x11. I can reproduce your issue though. I seems to be specific to chrome though, as the same thing works with firefox though (started with WAYLAND_DISPLAY being unset).

I am investigating the chrome bug, as that likely also affects a bunch of electron apps.

@Drakulix
Copy link
Member Author

Found the issue with chromium-based apps: Smithay/smithay#1864

Waiting for smithay review and merge

@Drakulix
Copy link
Member Author

Rebased with new smithay changes to fix chromium-based apps.

ids1024
ids1024 previously approved these changes Dec 1, 2025
Copy link
Member

@jacobgkau jacobgkau left a 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.

@jacobgkau
Copy link
Member

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).

@Drakulix
Copy link
Member Author

Drakulix commented Dec 3, 2025

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.

@Drakulix
Copy link
Member Author

Drakulix commented Dec 3, 2025

Pushed fix

@Drakulix Drakulix requested a review from jacobgkau December 3, 2025 16:03
Copy link
Member

@jacobgkau jacobgkau left a 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.)

@Drakulix
Copy link
Member Author

Drakulix commented Dec 4, 2025

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.

@Drakulix Drakulix force-pushed the smithay-dnd-update_noble branch from ac9b307 to 65e08a6 Compare December 4, 2025 16:04
@Drakulix Drakulix requested a review from jacobgkau December 4, 2025 16:05
@Drakulix
Copy link
Member Author

Drakulix commented Dec 4, 2025

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.

Copy link
Member

@jacobgkau jacobgkau left a 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.

@Drakulix
Copy link
Member Author

Drakulix commented Dec 4, 2025

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.

@Drakulix Drakulix merged commit 77d3605 into master Dec 4, 2025
6 checks passed
@Drakulix Drakulix deleted the smithay-dnd-update_noble branch December 4, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants