Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from May 15, 2024

Conversation

JunkuiZhang
Copy link
Contributor

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

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label May 13, 2024
@mikayla-maki
Copy link
Contributor

Glad we could trim that extra draw! Once this conflict is resolved, I'd be happy to merge this :D

@JunkuiZhang
Copy link
Contributor Author

Ready for review.

@mikayla-maki mikayla-maki merged commit a1e5f6b into zed-industries:main May 15, 2024
8 checks passed
osiewicz pushed a commit to RemcoSmitsDev/zed that referenced this pull request May 18, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants