This repository has been archived by the owner on Nov 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add serial to data control to avoid race condition with clipboard man…
…agers 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.
- Loading branch information
1 parent
16a2888
commit 0fc2b84
Showing
1 changed file
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters