Skip to content

wayland: show an icon under the pointer while dragging - #8

Open
kevinard wants to merge 1 commit into
canopa/wayland-drag-dropfrom
canopa/wayland-drag-icon
Open

kevinard wants to merge 1 commit into
canopa/wayland-drag-dropfrom
canopa/wayland-drag-icon

Conversation

@kevinard

@kevinard kevinard commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Canopa tracking PR. Stacked on canopa/wayland-drag-drop (#7) and merged into canopa/main; it is not meant to be merged here.

What

DragDrop::start_with_icon starts a drag like start, with an optional DragIcon that follows the pointer: straight RGBA pixels, a buffer scale and the hotspot that sits under the pointer. Its wl_surface takes the drag icon role in wl_data_device.start_drag; its wl_shm buffer is attached and committed then, offset with wl_surface.offset on version 5 or later and through attach before. The surface is destroyed when the drag ends. Without wl_shm the drag starts without an icon; an invalid icon is refused. start keeps its behaviour.

Why

Canopa Files drags files between windows and applications with no visible indication of what is dragged (Files ADR 0170). Other Wayland file managers show the dragged items' icons under the pointer.

Verification

cargo test --features wayland --lib drag: 7 passed, including the new icon validation test. Canopa builds against it through the iced fork's canopa/drag-icon.

Upstream

Applies on top of #7 (inventory W1b). Upstream master (0.31) has a drag source (rust-windowing#4571); when Canopa replaces #7 with it, check that API for icon support.

🤖 Generated with Claude Code

DragDrop::start_with_icon takes an optional DragIcon: straight RGBA
pixels, a buffer scale and the hotspot under the pointer. Its wl_surface
gets the drag icon role in start_drag and its shared-memory buffer is
committed then, with wl_surface.offset where available. The surface is
destroyed when the drag ends. Without wl_shm, drags start without an icon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kevinard added a commit to kevinard/canopa that referenced this pull request Nov 13, 2026
Browsing:
- Long names lose their middle; List headings sort and reverse on click,
  start at their leading edge, and dividers trade with the column beside them.
- Hover washes on rows, headings and quiet buttons; readable tooltips;
  menus open at the pointer and hold only what fits their context.
- Clicking empty space deselects; mouse Back/Forward buttons navigate;
  single click opens a folder in a parent column.
- List view can open folders in place as a tree; folders-first is an option.
  Both are global view settings.
- Emblems for links, unreadable and read-only items; themed icons for Home
  and the XDG personal folders.
- Status bar names the selected item and its type; "Recent activity" is gone.
- Properties panel renames from its name field and offers "Allow executing"
  under Access.
- Search uses the location field: its search button opens it and a cross
  closes it; the toolbar has no Search button.
- Unsaved-changes prompts are modal cards over a dimmed window.

Drag and drop:
- Drops into the items' own folder are refused; the pointer label appears
  only when a drop acts; dragged rows fade.
- Dragged items' icons follow the pointer (winit and Iced forks'
  start_with_icon, kevinard/winit#8 and kevinard/iced#9).

Tabs:
- A tab bar with close buttons, middle-click close, new-tab button and file
  drop targets.
- Tabs are dragged as native drags: their picture follows the pointer, a pin
  marks where they land, they move between windows, and a drag ending outside
  every Files window opens the tab in a new window. Escape gives up the drag.
  Keyboard: Move tab left/right and Move tab to new window.

Toolbar, places and Preferences:
- New Folder is an ordinary toolbar item; older toolbars keep it.
- The application mark before the toolbar is gone.
- Music, Videos, Templates and Public are built-in places; places use the
  icon theme's icons.
- Preferences' Toolbar, Sidebar and Shortcuts pages give each row its own
  controls, with pickers to add buttons and places.

Recorded in docs/files/adr/0170.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant