Skip to content

Support primary selection in data-control

These changes add support for the primary selection to the data-control protocol, alongside the regular selection. With these changes, clipboard managers (or tools like wl-clipboard) can work with both regular and primary clipboard contents without refraining to hacks like spawning invisible surfaces and stealing focus. See https://github.com/bugaevc/wl-clipboard/issues/24.

With these changes, invalidation of data offers is no longer "automatic" upon receiving a new data offer or selection, and instead should be controlled by the compositor using the new wlr_data_control_offer_v1.finished event. This is to support

  • two different data offers (one for the regular clipboard and one for the primary clipboard);
  • one data offer shared between the regular and the primary clipboard (think tools like xcutsel for synchronizing regular and primary clipboards: it's possible to simply receive the regular clipboard data offer and set it as the primary selection too without having to copy it).

cc @bugaevc @emersion

Merge request reports