S031: native drag and drop and file clipboard on X11
XDND v5 source and target on an own x11rb connection (proxy window via XdndProxy), CLIPBOARD owner and reader. Wayland and X11 share one Backend trait. examples/xdnd_probe drives both directions under Xvfb. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
e1d61b9d4c
commit
e8585da5ef
1 changed files with 944 additions and 63 deletions
|
|
@ -244,6 +244,15 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
|
|||
- Not done: no Wayland run at all (no headless compositor; orchestrator: no window on the live session); attach, drag out/in and clipboard with other apps are deferred to S036.
|
||||
- Later: Move/Link for drag out; modifiers for drags coming in (keyboard focus during a foreign drag).
|
||||
|
||||
## S031 — Native DnD and file clipboard on X11
|
||||
- Done: `native/x11.rs` `X11` (own `x11rb` RustConnection, `tunal-x11` event thread) behind the `Backend` trait now in `native/mod.rs` (Wayland implements it too; `Contents`, `Icon`, `ReadDone` moved there). A hidden InputOnly window of ours is the app window's `XdndProxy` (XDND messages go to the window creator's connection, which is winit's) and owns XdndSelection/CLIPBOARD.
|
||||
- Drag out: winit keeps the pointer grab, so `arm` starts a thread polling `query_pointer`; outside the window with button 1 held it becomes the XDND v5 source (Enter with type list, Position, Leave, Drop, waits for Finished; copy only; no drag icon on X11). Logs `start_drag`, `XdndEnter sent`, the finish.
|
||||
- Drag in: Enter/Position/Leave/Drop on the proxy → the same `Native` events as Wayland (Slint drop targets, glow, menu); the uri-list is converted at the first position; status answers every position with the target's accept.
|
||||
- Clipboard: copy/cut own CLIPBOARD (TARGETS + our mimes); paste asks a foreign owner's TARGETS (200 ms) then `x-special/gnome-copied-files`, falling back to `text/uri-list`.
|
||||
- Tool: `examples/xdnd_probe.rs` (dev-dep x11rb `xtest`), Xvfb only: drag out to a fake target, or `in x y uri` as a fake source.
|
||||
- Verified: build, clippy -D warnings, fmt; Xvfb `:97` with `WAYLAND_DISPLAY` unset: drag of notes.txt out of the window → app logs start_drag + XdndEnter sent + dropped (copy), probe got the uri-list; probe dropping a file on the Music row → status accept after the list was read, XdndFinished accept=1.
|
||||
- Not done: clipboard copy/paste not exercised (no key injection set up); no drag icon on X11; real apps in S036.
|
||||
|
||||
## Later
|
||||
- (orchestrator) Breadcrumb: a long path is hard-clipped at the bar's left edge with no elision mark, and the root crumb elides at 960 px — for S034.
|
||||
-
|
||||
|
|
|
|||
Loading…
Reference in a new issue