Weston implements no data-control protocol: background clipboard access steals keyboard focus, and nested compositors cannot watch the clipboard over Wayland
Summary
WSLg's Weston exposes no clipboard-manager protocol (neither wlr-data-control-unstable-v1 nor the newer ext-data-control-v1). As a result, a nested Wayland compositor running inside WSLg (sway, river, labwc, Hyprland, …) cannot be notified when the Windows clipboard changes, so clipboard sharing between Windows and applications inside the nested compositor can only be implemented by polling.
Clipboard sharing between Windows and WSLg's direct clients works fine. The gap is specific to nested compositors, which run as an ordinary WSLg client and therefore have their own, isolated Wayland display.
Environment
WSL version: 2.7.14.0
Kernel version: 6.18.33.2-2
WSLg version: 1.0.73.2
MSRDC version: 1.2.7214
weston: 04d436c7d9a0cd55fa64b6612c7fa678d6fcd077
Azure Linux: 3.0.20260510
Guest distro: Arch Linux (WSL), sway 1.12, wl-clipboard 2.3.0Details
WSLg's Weston advertises 20 globals; the only clipboard-related one is wl_data_device_manager:
$ WAYLAND_DISPLAY=wayland-0 wayland-info | grep -i data
interface: 'wl_data_device_manager', version: 3, name: 9For comparison, the nested sway compositor on the same machine advertises:
$ WAYLAND_DISPLAY=wayland-1 wayland-info | grep -iE 'data|primary'
interface: 'wl_data_device_manager', version: 3, name: 5
interface: 'zwlr_data_control_manager_v1', version: 2, name: 31
interface: 'ext_data_control_manager_v1', version: 1, name: 32
interface: 'zwp_primary_selection_device_manager_v1', version: 1, name: 55Core wl_data_device only delivers selection events to the client that currently holds
keyboard focus, which is by design and is exactly why clipboard managers need a privileged
extension. Consequently any attempt to watch WSLg's clipboard from a background client fails:
$ WAYLAND_DISPLAY=wayland-0 wl-paste --watch true
Watch mode requires a compositor that supports the data-control protocolOne-shot wl-paste / wl-copy against wayland-0 do work, so reading and writing are fine —
only change notification is missing.
Impact and current workaround
To bridge the clipboard between Windows and applications inside nested sway, I had to implement the two directions asymmetrically:
- nested → Windows: event-driven. sway supports data-control, so
wl-paste --watchworks. - Windows → nested: polling only (currently once per second), because of the above.
The polling cost is small but it is permanent, and the latency is bounded by the poll interval rather than being immediate.
Note that Weston itself does deliver wl_data_device.selection to the nested compositor,
because the nested compositor is the focused client — but a compositor is not expected to
re-export the parent selection to its own clients, so that path is not usable either.
Request
Please consider enabling a data-control protocol in WSLg's Weston — ext-data-control-v1
preferably, since it is the standardized successor, or wlr-data-control-unstable-v1 for
wider client compatibility. That would let clipboard managers and nested compositors receive
clipboard change notifications and make Windows↔nested clipboard sharing fully event-driven.
Related (nested/desktop usage of WSLg, no clipboard discussion): #101, #1019
Source: microsoft/wslg