# gpui: Fix window cursor style flickering \(\#32596\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7ecad2bef99122cbb796ad1d30243c28dd83822f

Requested commit: 7ecad2bef99122cbb796ad1d30243c28dd83822f

Commit: 7ecad2bef99122cbb796ad1d30243c28dd83822f

Tree: f9b176030fcb058098661a2acae2017c4c07641b

Author: Finn Evers

Committer: GitHub

## Message

```
gpui: Fix window cursor style flickering (#32596)

Closes #32592
Follow-up to #31965 

This PR fixes the cursor style flickering on Linux systems. The issue
arose since the window cursor style was not reused anymore for
subsequent frames after the changes in #31965. This works on MacOS for
hiding cursors, since they are hidden until the next mouse movement
occurs, which is not the case for other systems.

This PR re-adds this whilst keeping the fixes applied in #31965. We now
determine the first cursor style that is hovered and continue searching
for a cursor style that should be applied globally. If one to apply for
the whole window is found, we return that cursor style early instead.

Alternatively, we could store window cursor style request in a vector
similar to normal cursor styles. That would require more memory in
exchange for fewer checks which cursor style to apply. I preferred the
approach here, though, but can change this should the other method be
preferred.

CC @smitbarmase since you assigned yourself that issue.

Release Notes:

- Fixed an issue where the cursor would flicker whilst typing.
```

## Parents

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

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