# x11: Don't skip consecutive same key press events in the same batch \(\#38154\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f3e49e1b05a022a3f4b116721035790fd839b367

Requested commit: f3e49e1b05a022a3f4b116721035790fd839b367

Commit: f3e49e1b05a022a3f4b116721035790fd839b367

Tree: cc98cc1f8a9c01883aa84bdeac826b9e12f70954

Author: Michael Sloan

Committer: GitHub

## Message

````
x11: Don't skip consecutive same key press events in the same batch (#38154)

This has noticeable misbehavior when framerates are low (in my case this
sometimes happens when CPUs are throttled and compilation is happening),
as now a batch of x11 events can contain events over the span of 100s of
millis. So in that case, key press repetitions with quite normal typing
are skipped.

Under normal operating conditions it can be reproduced by running this
and quickly switching to Zed:

> sleep 1; for i in {1..5}; do xdotool type --delay 5 "aaaaaa "; xdotool
key Return; done

Output before looks like:
```
aaa
aaaaa
aaa
aaa
aaaa
```

Output after looks like:
```
aaaaaa
aaaaaa
aaaaaa
aaaaaa
aaaaaa
```

This behavior was added in #13955.

Release Notes:

- N/A
````

## Parents

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

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