Find a file
David Edmundson 8425cd06fd Add serial to data control to avoid race condition with clipboard managers
A typically clipboard manager works as follows:

 - On a new clipboard, we copy any text
- If the clipboard becomes empty (typically because a client died), we
paste our previously copied text

Our race happens as follows:

first copy:
 -    client creates a wl_data_offer
-   compositors sees it forwards it clipboard manager which copies the
text...

second copy:
 - client deletes its old wl_data_offer before creating a new one

 - compositor forwards this update to clipboard manager

- clipboard manager knows the clipboard is empty and starts its
operation to prevent an empty clipboard

 - client creates a new wl_data_offer and calls set_selection

- clipboard manager  creates a new wlr_data_offer (with the old
clipboard text) and calls set_selection

The compositor can get these last two in any order, and we end up
replacing our new clipboard content with out-of-date previous clipboard
contents.

This patch adds a serial number that can be used when a set_selection is
used in repsonse to a selection event.
2021-09-30 15:07:15 +01:00
unstable Add serial to data control to avoid race condition with clipboard managers 2021-09-30 15:07:15 +01:00
.build.yml Fix git remote in .build.yml 2018-05-29 14:20:45 +01:00
.editorconfig Add .editorconfig 2018-05-29 11:31:41 +01:00
check.sh Add Makefile and pkg-config entry 2018-10-12 10:14:24 -04:00
Makefile Add output power management protocol 2020-02-20 16:24:07 +01:00
README.md Add README 2020-06-30 14:14:02 -06:00
wlr-protocols.pc.in Add Makefile and pkg-config entry 2018-10-12 10:14:24 -04:00

wlr-protocols

Wayland protocols designed for use in wlroots (and other compositors).

Submitting changes to existing protocols

Please submit a pull request on GitHub.

Submitting new protocols

New protocols should not be submitted to wlr-protocols. Instead, submit them to wayland-protocols.