Merge branch 'github/fork/davidedmundson/wlr_data_serial' into 'master'

Add serial to data control to avoid race condition with clipboard managers

See merge request wlroots/wlr-protocols!94
This commit is contained in:
Simon Ser 2025-08-27 18:37:38 +00:00
commit 2db2f82339

View file

@ -44,7 +44,7 @@
For clipboard management, use the ext-data-control-v1 protocol.
</description>
<interface name="zwlr_data_control_manager_v1" version="2">
<interface name="zwlr_data_control_manager_v1" version="3">
<description summary="manager to control data devices">
This interface is a manager that allows creating per-seat data device
controls.
@ -74,7 +74,7 @@
</request>
</interface>
<interface name="zwlr_data_control_device_v1" version="2">
<interface name="zwlr_data_control_device_v1" version="3">
<description summary="manage a data device for a seat">
This interface allows a client to manage a seat's selection.
@ -144,7 +144,7 @@
<!-- Version 2 additions -->
<event name="primary_selection" since="2">
<event name="primary_selection" since="3">
<description summary="advertise new primary selection">
The primary_selection event is sent out to notify the client of a new
wlr_data_control_offer for the primary selection for this device. The
@ -186,9 +186,33 @@
<entry name="used_source" value="1"
summary="source given to set_selection or set_primary_selection was already used before"/>
</enum>
<!-- Version 3 additions -->
<event name="selection_serial" since="3">
<description summary="copy data to the selection">
This should be sent by compositors before a selection event with an
increasing serial number.
This can be used by the client in partnership to set_selection_response
to indicate pairing of a selection event to a reply.
</description>
<arg name="serial" type="uint"/>
</event>
<event name="primary_selection_serial" since="3">
<description summary="copy data to the selection">
This should be sent by compositors before a primary_selection event
with an increasing serial number.
This can be used by the client in partnership to set_selection_response
to indicate pairing of a selection event to a reply.
</description>
<arg name="serial" type="uint"/>
</event>
</interface>
<interface name="zwlr_data_control_source_v1" version="1">
<interface name="zwlr_data_control_source_v1" version="3">
<description summary="offer to transfer data">
The wlr_data_control_source object is the source side of a
wlr_data_control_offer. It is created by the source client in a data
@ -236,9 +260,25 @@
The client should clean up and destroy this data source.
</description>
</event>
<!-- Version 3 additions -->
<request name="serial" since="3">
<description summary="Specifies the serial this event is in reply to">
Clients can optionally specify a serial for this source indicating that
it is in response to a previous data device event. For example a
clipboard manager updating the text after a a set_selection event with
an empty selection.
Compositors may disregard this set_selection event if it is deemed
outdated.
</description>
<arg name="serial" type="uint"
summary="Serial of this data source"/>
</request>
</interface>
<interface name="zwlr_data_control_offer_v1" version="1">
<interface name="zwlr_data_control_offer_v1" version="3">
<description summary="offer to transfer data">
A wlr_data_control_offer represents a piece of data offered for transfer
by another client (the source client). The offer describes the different