# windows: Use \`DwmFlush\(\)\` to trigger vsync event \(\#11731\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a1e5f6bb7cc68f55fe3a0405a83bcdd63f2d8f02

Requested commit: a1e5f6bb7cc68f55fe3a0405a83bcdd63f2d8f02

Commit: a1e5f6bb7cc68f55fe3a0405a83bcdd63f2d8f02

Tree: 352ba79710c0f2b77ae9ee11570f6fa91ba1bfaa

Author: 张小白

Committer: GitHub

## Message

```
windows: Use `DwmFlush()` to trigger vsync event (#11731)

Currently , on Windows 10, we used a `Timer` to trigger the vsync event,
but the `Timer`'s time precision is only about 15ms, which means a
maximum of 60FPS. This PR introduces a new function to allow for higher
frame rates on Windows 10.

And after reading the codes, I found that zed triggers a draw after
handling mouse or keyboard events, so we don't need to call draw again
when we handle `WM_*` messages. Therefore, I removed the
`invalidate_client_area` function.

Release Notes:

- N/A
```

## Parents

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

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