Skip to content

fix(clipboard): offer and read the file-manager clipboard formats - #2040

Merged
l0gicgate merged 2 commits into
mainfrom
fix/2028-clipboard-formats
Nov 2, 2026
Merged

l0gicgate merged 2 commits into
mainfrom
fix/2028-clipboard-formats

Conversation

@l0gicgate

Copy link
Copy Markdown
Contributor

Description

Copy and cut only put a GdkFileList on the clipboard, which GTK advertises as text/uri-list and plain text. Nemo, Caja, Thunar and the Desktop Icons NG extension (the version Ubuntu 24.04 and Zorin 18 ship) enable Paste only when x-special/gnome-copied-files is offered, so files copied in Strata could not be pasted into them. KDE reads text/uri-list but takes its cut flag from application/x-kde-cutselection, so a Strata cut pasted in Dolphin as a copy. Nautilus falls back to the file list, which is why stock GNOME never showed the problem.

Copy and cut now publish a union of the file list, text/uri-list, the GNOME format with its copy/cut header, and the KDE cut flag. Paste reads the GNOME header or the KDE flag first, so a cut made in another file manager moves instead of copying; Strata's own cut tracking is unchanged.

The QA clipboard_set step accepts raw MIME offers and the clipboard step reads one MIME type from the second display connection, so the new scenarios check both directions: copy-offers-file-manager-formats reads the three payloads after Ctrl+C and Ctrl+X, and paste-honors-foreign-cut-markers pastes clipboards filled the way Nemo/Nautilus and KDE fill them.

The second point in #2028, launching .desktop entries from the browser, is a separate defect and is not part of this change.

Visual evidence

N/A. The change is clipboard content; the visible effect is Paste becoming enabled in other file managers.

How to test

  1. In Strata, select a file and press Ctrl+C.
  2. In Nemo, Thunar, Caja, or on a GNOME desktop with Desktop Icons NG, right-click a folder background and choose Paste.
  3. Back in Strata, select a file and press Ctrl+X, then paste it in Dolphin or Nautilus.
  4. In Nautilus or Dolphin, cut a file, then paste it into a Strata folder with Ctrl+V.

Expected result: Paste is enabled and copies the file in step 2. Step 3 moves the file. Step 4 moves the file instead of copying it; a copy in the other file manager still copies.

Related issue

Closes #2028
Closes #2034

Copy and cut only put a GdkFileList on the clipboard, which GTK serializes
as text/uri-list. Nemo, Caja, Thunar and the Desktop Icons NG extension
paste only from x-special/gnome-copied-files, so Strata's copies could not
be pasted there, and KDE never saw a cut.

Publish a union of the file list, text/uri-list, the GNOME format with its
copy/cut header, and the KDE cut flag. On paste, read the GNOME header or
the KDE flag so a cut made in another file manager moves instead of
copying.

The QA clipboard_set step now takes raw MIME offers and the clipboard step
reads one MIME type, so scenarios can drive both directions.
@github-actions github-actions Bot added the fix label Nov 2, 2026
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.

Can not copy file from strata to desktop strata and the built-in file manager do not support bidirectional copy and paste[Ubuntu budgie 26.04]

1 participant