# linux/x11: prioritize input in the event loop \(\#8253\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 885ae2d863c633c20807d6086c228f76035e3cf7

Requested commit: 885ae2d863c633c20807d6086c228f76035e3cf7

Commit: 885ae2d863c633c20807d6086c228f76035e3cf7

Tree: fe9cedbcfc2958d8e5188dc6176e2fd536e42739

Author: Dzmitry Malyshau

Committer: GitHub

## Message

```
linux/x11: prioritize input in the event loop (#8253)

With this change, interaction with Zed is actually real-time and usable
:rocket: :tada:

The gist of it is - trying to process all of the input events before
rendering anything.

Release Notes:
- N/A

**Note**: this can be further improved in a follow-up.
Currently, once the input and runnables are processed, we'd try to draw
+ render a frame.
Presentation starts with acquiring a new frame. We currently have FIFO
presentation method, so acquiring a frame is blocking on that swapchain
image to become available. As the result, presentation takes around 16
ms, most of which is just busy wait.
Ideally, we'd be able to process more input in this time frame, instead.

**Note2**: it's a bit laggy in Debug for me, but that's just because of
the extra-long `draw` times, which is unrelated to rendering (or
platform support, for the matter). I'm curious how come on MacOS the
`draw()` times in Debug are more modest.
```

## Parents

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

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