[PATCH] protocol: Add DnD actions

Bill Spitzak spitzak at gmail.com
Mon Feb 16 13:17:08 PST 2015


I would think the drop target client can figure out what action to 
perform, there is no need to communicate it's set of actions to the 
compositor or for the compositor to have any of this logic to "determine 
the action both parts agree on".

The drop target will have to say what action it did. It also sounds like 
you are concerned that the source may want to know the action on drag 
events so the source can update the cursor or redraw the source location 
to show the result of the action. But this is only one action, not a list.

So basically it seems like any lists from the drop target can be 
avoided. The drop target would only send a single action.

The compositor can throw a protocol error if the client sends an action 
that is not in the list. Or it could just convey it right through and 
let the drag source client ignore it.

On 02/16/2015 07:37 AM, Carlos Garnacho wrote:
> These 2 requests have been added:
>
> - wl_data_source.notify_actions request: Notifies the compositor of the
>    available actions on the data source.
> - wl_data_offer.notify_actions request: Notifies the compositor of the
>    available actions on the destination side, plus the preferred action.
>
> Out of the data from these requests, the compositor can determine the action
> both parts agree on (and optionally let the user play a role through eg.
> keyboard modifiers). The chosen option will be notified to both parties
> through the following two requests:
>
> - wl_data_source.action
> - wl_data_offer.action


More information about the wayland-devel mailing list