Files
chandra/compositor/host
Claude 76a23f7816
CI / test (push) Canceled after 4m0s
Drag and drop: files can be dragged between windows and within one
The compositor ignored wl_data_device.start_drag, so no drag ever reached a
window: Dolphin, GNOME Files, Chrome tabs and text could not be dropped
anywhere, not even inside the window they started in.

Now (compositor/wayland/dnd.mbt, compositor/host/dnd.mbt):
- start_drag while a button is held on the client turns the pointer into the
  drag (the origin gets wl_pointer.leave); a request that arrives after the
  release is cancelled at once.
- The surface under the pointer (windows, subsurfaces, menus) gets
  data_offer + offer + source_actions + enter, then motion and leave; a drag
  without a source stays inside its own client.
- accept -> source.target, set_actions -> copy/move/ask agreed and sent as
  offer.action and source.action (version 3), version 1/2 clients copy.
- Release drops when the target accepted a type and an action: drop,
  dnd_drop_performed, and finish -> dnd_finished; otherwise cancelled + leave.
  Escape cancels. The window dropped on becomes active, so Dolphin's
  Copy/Move Here menu opens as a menu of a focused window.
- The drag icon is drawn under the pointer at its hotspot (attach offsets and
  wl_surface.offset), above windows and menus.
- A source, icon or client going away ends or updates the drag.

Tests: compositor/host/dnd_test.mbt (fail on the previous commit). Checked
headless with real Dolphin 23.08 (Qt 5.15) and GNOME Files 46 on both the
native build and the wasm build: Files -> Dolphin, Dolphin -> Files,
Dolphin -> Dolphin (Move/Copy/Link menu) and a move into a folder inside Files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjWb2dWbR1K7qoMgWP
2026-11-26 05:31:33 +00:00
..
2026-11-26 04:19:19 +00:00