Using the same wl_data_source multiple times

Simon Ser contact at emersion.fr
Thu Jan 31 17:51:46 UTC 2019


Hi,

I've been wondering about an under-specified part of the core protocol:
is it possible to create a data source (via
wl_data_device_manager::create_data_source) and then to use it multiple
times?

Here are a few examples of what "use it multiple times" could look like:

1. Call set_selection or start_drag twice on the same wl_data_device
   with the same source
2. Call set_selection and start_drag on the same wl_data_device with the
   same source
3. Call set_selection on two different wl_data_device objects with the
   same source

Are any of those allowed? Weston doesn't seem to handle this case.

TBH, I think it should be disallowed by the protocol. The wl_data_source
interface contains some events that track the state of the current
selection/drag-and-drop operation. For instance, the "cancelled" event
is sent when the data source is replaced by another one. It's not clear
when to send it if the source is e.g. being replaced by itself. There
are other events related to drag-and-drop, and it's not clear what to do
if multiple drag-and-drop operations are in progress at the same time on
different seats.

I'd like to explicitly disallow this in the protocol, for instance by
changing create_data_source's description.

Thoughts?

Thanks,

--
Simon Ser
https://emersion.fr




More information about the wayland-devel mailing list