input/dnd: add Source::accepted so proxying sources can relay the target's choice - #2146
Merged
Merged
Conversation
5 tasks
dahankzter
force-pushed
the
dnd-accept-hook
branch
from
August 28, 2026 17:07
24bba0c to
f047a8c
Compare
…get's choice Source has hooks for the other two target->source requests - send for receive, choose_action for set_actions - but nothing for accept, so a proxying source cannot relay it anywhere. Nested compositors need it. When one forwards a drag to its own clients it acts as the Source, and the host compositor only sends drop once the nested compositor has itself accepted on the upstream offer. Without a signal that a nested client accepted, it never can, and the drop is silently discarded. Default no-op, so existing implementations are unaffected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCQQAWhxyYJwT49Zvcko6z
dahankzter
force-pushed
the
dnd-accept-hook
branch
from
August 28, 2026 17:07
f047a8c to
46fedc4
Compare
Drakulix
approved these changes
Sep 2, 2026
Drakulix
left a comment
Member
There was a problem hiding this comment.
Thanks. I don't see any issues with this approach. :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sourcehas hooks for the other two target->source requests —sendforreceive,choose_actionforset_actions— but nothing foraccept.handle_dndsetsdata.acceptedand that's the end of it.That breaks proxying sources. A nested compositor forwarding a drag to its own clients implements
Source, and the host compositor only sendsdroponce that nested compositor has accepted on the upstream offer. It currently has no way to know when to do that, so the drop never arrives and the drag just ends inleave.This adds
Source::accepted(Option<String>), called from theAcceptarm. Default no-op, so nothing existing changes.Found while fixing drag-and-drop onto cosmic-panel applets, which is broken for exactly this reason: pop-os/cosmic-panel#675, which uses this hook and is tested working against it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DCQQAWhxyYJwT49Zvcko6z