Skip to content

Implement wlr_data_{source,device,device_manager}

Jan Kelling requested to merge github/fork/nyorain/wlr_data_device_manager into master

This implements the most important interfaces for data exchange. It does more than just stub functions, it basically finishes all implementations already. wl_data_offer is left completely undone since most of it will be handled by the user and it will only be needed when we want to get clipboard to work. I could therefore also only test this in a theoretical way (creating and setting the selection using weston-terminal) which works.

A little explanation since there may be a few unexpected places and this is handled different (better) than wlc does it:

  • it does already correctly implement multi-seat support
    • since wl_data_device is basically the child of wl_data_device_manager and wl_seat those resources are added to the seat_handle struct. This might sound weird first but it is closely connected to it. When a data_device start a dnd operation it grabs the seat. When the keyboard resource is focused, the user will send a data offer using the associated data device
    • it associates the wlr_data_device directly with a wlr_seat to make this work
  • it currently suffers from the same simplification as wlr_seat: there could theoretically be multiple wl_data_device resources for one client and seat but we ignore it at the moment (that should be fixed as well when it is fixed on day for the other seat resources)
  • wlr_data_source is a virtual interface to allow stuff like x11 data sources later on or allow the user to set their own data sources (where ever they get them from, like e.g. in sway the set_clipboard functionality)

With this architecture it should be pretty easy to implement dnd later on (basically only surface roles + seat grab).

Merge request reports

Loading