# gpui_linux: Fix Wayland serial token tracking \(\#61454\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/dc2a339d5d043da448a3f7ddc7c0a85c63864aad)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: dc2a339d5d043da448a3f7ddc7c0a85c63864aad

Requested commit: dc2a339d5d043da448a3f7ddc7c0a85c63864aad

Commit: dc2a339d5d043da448a3f7ddc7c0a85c63864aad

Tree: 643cebab11c7480e339eb4fb6f9fe02b4f55b5de

Author: Jakub Konka

Committer: GitHub

## Message

```
gpui_linux: Fix Wayland serial token tracking (#61454)

Closes #58651 
Closes FR-123

https://github.com/zed-industries/zed/pull/50406/ while fixing one issue
regressed serial tracking in Wayland. What happens is we conflated
unrelated serials into a common value which is wrong. For example,
`InputMethod` serial does not come from the same source as `MousePress`
or `KeyPress`, and if Zed is running for a while and the user performs
lots of IME commits (`zwp_text_input_v3.commit`), `InputMethod` will
overtake other serial values and will be incorrectly used for clipboard
authorisation/selection by the compositor such as Mutter or kWin. This
will effectively poison the clipboard making Zed the indefinite owner
until we kill Zed. More concretely, we use `get_latest()` on the serial
tracker to extract *the largest serial REGARDLESS of kind* which is
wrong since not every serial kind comes from the same pool.

Release Notes:

- Fixed copy-paste behaviour in Wayland.
```

## Parents

- [775e51f95cdfa336c88145ef2a4c1182a1de70a4](https://git.cafe/gitcafe/zed/commit/775e51f95cdfa336c88145ef2a4c1182a1de70a4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/dc2a339d5d043da448a3f7ddc7c0a85c63864aad?format=markdown)
