Skip to content

fix(browser): keep same-volume move when Wayland narrows an in-app drop to copy - #2661

Merged
l0gicgate merged 3 commits into
lgse:mainfrom
mvanhorn:fix/2107-wayland-same-volume-drag-move
Nov 24, 2026
Merged

l0gicgate merged 3 commits into
lgse:mainfrom
mvanhorn:fix/2107-wayland-same-volume-drag-move

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

On Wayland, a quick drag between folders on the same volume can leave the item in both places when the user expects it to move. While the volume lookup is pending, Strata reports COPY as its preferred action. Wayland can narrow the drop to COPY before the lookup finishes, and the classifier then treats MOVE as unavailable even though the in-app drag source offered it.

The classifier now reads the original action set from the in-app drag source when available. External drops use the negotiated actions, and the debug log records both action sets.

Visual evidence

N/A: no interface change. A same-volume drag now moves the item instead of copying it.

How to test

  1. Start Strata in a Wayland session.
  2. Quickly drag a file or folder onto another folder on the same volume, without holding a modifier.
  3. Drag another item the same way while holding Ctrl.
  4. With the Settings choice for drops onto a different drive or share set to ask, drag an item onto a folder on another drive.

Expected result: The first item moves and no copy stays behind. The Ctrl drag copies. The drag onto another drive opens the "Copy or move?" prompt.

Related issue

Closes #2107

AI was used for assistance.

mvanhorn and others added 2 commits November 23, 2026 23:18
The classifier now reads the original action set from the in-app drag
source when available. External drops use the negotiated actions, and
the debug log records both action sets. A regression test checks that a
same-volume drop resolves to MOVE when the source offers COPY and MOVE
but the negotiated action is COPY.

Fixes lgse#2107
The helper only wrapped Option::unwrap_or, and its test asserted that
wrapper rather than the drop route, which needs a real Wayland drop to
exercise.
@l0gicgate
l0gicgate force-pushed the fix/2107-wayland-same-volume-drag-move branch from 6d62c39 to 87cd341 Compare November 24, 2026 05:42
@l0gicgate
l0gicgate changed the base branch from strata-next to main November 24, 2026 05:42
@l0gicgate
l0gicgate force-pushed the fix/2107-wayland-same-volume-drag-move branch from 87cd341 to 6c4df1e Compare November 24, 2026 05:43
@l0gicgate

l0gicgate commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the fix. I reviewed it and prepared it for merge.

Retargeted to main. The PR was opened against strata-next, which has since removed the GTK application, including both files changed here. I rebuilt the branch as current main plus your commit (authorship kept) and changed the base to main, which needed a force-push to your branch. The Rune drag-and-drop code on strata-next reads the Wayland source's full action set itself, so it does not need this change.

Review change (3772e4f): inlined file_drop_source_actions and removed in_app_drag_keeps_move_when_the_drop_is_copy_only. The helper only wrapped Option::unwrap_or, and the test asserted that wrapper, so it would still pass with the bug back in classify_file_drop. A real test needs a Wayland drop whose negotiated action differs from its source's offer, which the X11 test display cannot produce. I also rewrote the "How to test" section as manual steps.

The fix works. I ran the QA drop scenarios on a private headless sway 1.12 with GTK 4.24.1 (STRATA_QA_DISPLAY=wayland, in a throwaway container). This is a diagnostic run, not validation evidence:

Failing runs out of 59
main without the fix 32
With the fix 11

The runs it fixes are the same-volume moves, which fail intermittently per run (drag-file-onto-folder, folder-into-another-folder, multi-selection-drag-moves-every-entry, sidebar-destinations-accept-three-files, drag-from-clipped-column-narrow-window, strip-edge-scrolls-columns-in) and all 13 cross-volume-enter-choice runs, where the "Copy or move?" prompt never opened. The 11 that still fail are the Escape-cancels-a-drag steps in drop-folder-into-itself, hovered-tab-takes-drop and filtered-result-to-sidebar-folder. They fail at the same lines without the fix, so they are a separate Wayland problem.

Local checks on the final code

  • ./scripts/test-headless.py ui::browser::clipboard: 44 passed.
  • ./scripts/quality.sh fmt and ./scripts/quality.sh clippy: pass.
  • ./scripts/qa.sh --test-threads 6 on the same 16 drop scenarios in the pinned container (X11): 59 passed, 0 failed.
  • CodeScene score for src/ui/browser/clipboard.rs is unchanged at 7.18.

The full Rust suite was not run locally; the change is confined to one classifier and CI runs the full suite.

CI: all checks pass on 6c4df1e (QA scenarios are dispatch-only and were run locally, above).

@l0gicgate
l0gicgate merged commit a40afc4 into lgse:main Nov 24, 2026
14 checks passed
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Thanks for merging this, @l0gicgate. Same-volume drags on Wayland should move the item again instead of leaving a copy behind when the drop gets narrowed before the volume lookup finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(drag): quick same-volume drags still copy instead of move on Wayland (#1958 reproduces on a real compositor)

2 participants