Products › lamco-dsi-tools › Interfaces › Clipboard portal

xdg-desktop-portal Clipboard: The remote desktop clipboard on Wayland

xdg-desktop-portal Clipboard gives a RemoteDesktop session the Wayland clipboard, the route on GNOME: How it works, who offers it, and how to check it.

D-Bus portal org.freedesktop.portal.Clipboard

The xdg-desktop-portal Clipboard interface, org.freedesktop.portal.Clipboard, gives a program the desktop's clipboard as part of a portal session: A remote desktop server asks for it alongside the keyboard and pointer, and after the permission dialog can read what's copied on the desktop and put content there. On desktops that offer no data-control protocol, GNOME among them, it's the one route to the clipboard for a program without a focused window. lamco-dsi-tools (DSI: Desktop session interfaces) records whether the portal exports it, opens a session with the clipboard asked for when you allow the dialog, watches and reads the selection through it, and sets content through it with dsido.

What it is

The Clipboard portal doesn't create sessions of its own. It extends a session another portal created: A RemoteDesktop session, and in the current documentation also an InputCapture session. The program calls RequestClipboard on the session before Start, and the answer to Start says in clipboard_enabled whether access was granted. A backend that doesn't implement the clipboard, or a person who leaves it unchecked in the dialog, gives a session that started with the clipboard off.

The transfer follows mime types and ownership, much as Wayland's own clipboard does. The SelectionOwnerChanged signal tells the session when the clipboard's owner changes, with the mime types on offer. To read, the session calls SelectionRead with a mime type and gets a file descriptor to read the content from. To set, it calls SetSelection with the mime types it has. When something on the desktop then pastes, the portal emits SelectionTransfer with a mime type and a serial, and the session calls SelectionWrite with that serial for a file descriptor, writes the content, and calls SelectionWriteDone.

Against ext-data-control-v1 and wlr-data-control, the portal route has a dialog, belongs to one session, and ends with it. A clipboard that doesn't sync in a remote desktop session on GNOME is a question about this interface: Whether the portal exports it, whether clipboard_enabled came back true, and whether the signal and the read arrived.

The toolkit records each SelectionOwnerChanged as sent, every option with its D-Bus signature, and reads the mime types from an array of strings or from a structure that holds one, which is how GNOME Shell 48.7 sends them. It calls a selection cleared only when the signal names no mime type.

Which desktops offered it

DesktopState
GNOME Shell 48.7 (Debian 13)present
GNOME Shell 51.0 (Fedora 45)present
KDE Plasma, KWin 6.5.6 (NixOS)present
KDE Plasma, KWin 6.8.2 (KDE neon)present
Sway 1.9not examined
Hyprland 0.56.2absent
COSMIC, cosmic-comp 1.0.0absent
labwc 0.20.3 (Budgie session, CachyOS)absent
Cinnamon Wayland session (Linux Mint)absent

The matrix's row is "Clipboard portal (on a RemoteDesktop session)". The captures were taken on 2026-11-27 and 2026-11-28 with dsisee observe, one version of each desktop on one virtual machine, with no dialog answered, so present means offered and no session was opened. Sway's portal wasn't running, so its cell is not examined. Hyprland, COSMIC and labwc offer both data-control protocols instead.

The README's run record: On Mutter 48.7 the portal route's selection signal was read, in its (as) form. The read of the content failed with EAGAIN, since GNOME hands back a pipe that isn't ready yet. clipboard routes was run on GNOME Shell 48.7.

The project's record of runs, reconciled on 2026-12-04, adds:

  • The portal route of the clipboard, on GNOME, among the runs of 2026-11-27 to 2026-11-29: After the read was changed to wait on its pipe, 26 bytes were read through GNOME's portal. The record of that read doesn't name the GNOME release.

How to check it with lamco-dsi-tools

dsisee clipboard routes                                         # every clipboard route: the registry and the portal
dsisee portal diagnose --wake-portal                            # Clipboard and RemoteDesktop, with their versions
dsisee clipboard observe --route portal --duration 10 --out watch.json         # a session with the clipboard (dialog)
dsisee clipboard observe --route portal --read --duration 10 --out read.json   # also read each selection's content
dsitell health watch.json                                       # the clipboard function and its routes

The portal route needs a build with both the clipboard and eis features, which the release tarballs have. --route auto takes it only with --allow-dialogs, and only where the compositor advertises no data-control protocol. The capture holds each step of opening the RemoteDesktop session, the interface versions, and whether the portal's answer says the clipboard is enabled. A read waits on the pipe SelectionRead hands out, and one that never becomes readable within --read-timeout ends as timed_out. Only the length and SHA-256 of what was read are kept.

Driving it with dsido

dsido clipboard set --route portal --hold 10 --out set.json   # put marked content on the clipboard (dialog)

It replaces what the clipboard holds and doesn't put it back. Each time something on the desktop pastes, the capture records the request and when the content had been written. Pair it with a watcher's capture with dsitell clipboard set.json watch.json.

Findings

  • CLIP-005: The portal started a session with the clipboard not enabled.
  • CLIP-002: The compositor offers no data-control protocol, so the portal is the remaining route.
  • CLIP-001: No clipboard route was found.
  • CLIP-003: A clipboard dissector or driver failed.
  • CLIP-004: A selection's content didn't arrive whole.
  • PORTAL-002: The portal has no RemoteDesktop interface for the clipboard to ride on.

Related