Daily Shaarli

All links of one day in a single page.

October 25, 2022

How the clipboard works in Wayland

TL;DR:

  1. The application creates a wl_data_source object, indicating that it’s going to offer data to other applications.
  2. The application adds the mime types that it can handle to the data source (with wl_data_source::offer)
  3. The application finally calls wl_data_device::set_selection, to indicate “I’m taking ownership of the clipboard, and the above created wl_data_source is what I’m offering”.