Repository navigation
fix(wayland): fall back to offered action when dnd_finished arrives without action - #2639
Merged
Merged
Conversation
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.
Addresses #526.
Root cause
On Wayland
wl_data_sourcev3+,dnd_finishedonly fires after the drop destination accepted and finished the drop (wl_data_source.cancelledfires on cancellation). Compliant compositors emitwl_data_source.actionbeforednd_finished, settingDragSession::selected_action.Hyprland <= v0.57.2 (fixed upstream on
mainin hyprwm/Hyprland#16808 after v0.57.2) emitsdnd_finishedwithout ever sendingwl_data_source.action. Becauseselected_actionremainedSourceAction::None,Event::Finishedresolved toDragOutcome::Cancelledon every completed drop.Fix
offered_actionsbitmask onDragSessionwhen a drag starts (crates/rune/src/platform/wayland/drag_source/machine.rs).SourceAction::to_outcomewithSourceAction::finished_outcome(offered_actions)forEvent::Finished:SourceAction::Copy->DragOutcome::Copied(unchanged)SourceAction::Move->DragOutcome::Moved(unchanged)SourceAction::None) ondnd_finished:Copyoffered (includingCopy | Move) ->DragOutcome::Copied(safe non-destructive default; never falsely reportsMovedon aCopy | Movedrag)Moveoffered ->DragOutcome::MovedDragOutcome::CancelledEvent::Cancelledcontinues to reportDragOutcome::Cancelled.Verification
cargo check -p rune --libandcargo test -p rune --lib drag_source(14 passed, 0 failed) on Windows, including new unit and state-machine tests covering Hyprland'sdnd_finished-without-actionsequences (Copy,Copy | Move,Move-only,None, explicitCancelled, and explicitAction(Move)).