Two independent bugs prevented tab drag-and-drop reorder from working on cosmic-comp (and likely other compositors): 1. allow_reorder required DndAction::Move to be negotiated via OfferEvent::SelectedAction, which cosmic-comp does not always emit for self-drops (the SelectedAction event either never arrives or arrives with DndAction::empty()). Add a fallback: accept self-drops whenever state.dragging_tab is set. dragging_tab is only populated by start_tab_drag on this same widget, so this is safe; mime match and on_reorder presence are checked below. 2. reorder_event_for_drop preferred drop_hint.side over positional swap, producing counter-intuitive no-ops: dropping A (pos 0) on the left half of B (pos 1) resolved to "Before B" which, after removing A, lands at pos 0 again — the tab appeared not to move. Always use default_insert_position, which derives direction from dragged vs target positions (Konsole/Firefox/Chrome-style swap semantics). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| model | ||
| horizontal.rs | ||
| mod.rs | ||
| style.rs | ||
| vertical.rs | ||
| widget.rs | ||