PRIMARY selection handling for Wayland Lyude 2015 Sponsered by Red Hat -------------------------------------------------------------------------------- --- Synopsis --- In order for the transition from X to Wayland to be easy for users, we have to account for some of the smaller features of X that people will forever cling to. One of these features is middle click pasting, where one application can have a body of text selected, and that text will be pasted to another application by clicking the middle mouse button as long as the text remains selected. This is a port of that functionality for Wayland. The protocol adds a single global object called primary_selection_manager. This singleton object provides notifications for when there's data available in the primary buffer, when said data changes, and mechanisms for setting the contents of the PRIMARY buffer. --- The Protocol --- primary_selection_manager: Handles notifying clients when they're allowed to read the contents of the primary buffer, along with handling setting the contents of the primary buffer. Requests: set_contents: Sets the current contents of the primary selection buffer. This request should only be valid when the client's surface currently has focus. Arguments: data: The wl_data_source containing the data to hold in the primary selection. Events: contents_changed: Means another client has set the contents of the primary selection. This means whatever we've set in the primary buffer has been replaced. contents_available: Sent when the client has permission to read from the primary selection if it chooses. This event is sent before any other events that may have triggered it. For example; if a middle click triggers primary selection pasting this event would be sent first, followed by the middle click event. Arguments: contents: A wl_data_offer containing the contents of the primary selection