Files
oak-gpui/crates
张小白andMax Brunsfeld b62f959528 windows: Fix message loop using too much CPU (#35969)
Closes #34374

This is a leftover issue from #34374. Back in #34374, I wanted to use
DirectX to handle vsync, after all, that’s how 99% of Windows apps do
it. But after discussing with @maxbrunsfeld , we decided to stick with
the original vsync approach given gpui’s architecture.

In my tests, there’s no noticeable performance difference between this
PR’s approach and DirectX vsync. That said, this PR’s method does have a
theoretical advantage, it doesn’t block the main thread while waiting
for vsync.


The only difference is that in this PR, on Windows 11 we use a newer API
instead of `DwmFlush`, since Chrome’s tests have shown that `DwmFlush`
has some problems. This PR also removes the use of
`MsgWaitForMultipleObjects`.


Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-08-12 11:28:47 -07:00
..
2025-08-05 18:16:47 +00:00
2025-08-06 09:01:06 +00:00
2025-07-29 13:24:34 -07:00
2025-08-05 18:16:47 +00:00
2025-07-21 13:44:51 +02:00
2025-06-17 20:26:27 +00:00
2025-07-17 14:25:55 +00:00
2025-07-08 14:34:57 +00:00
2025-08-06 00:02:26 +00:00
2025-08-07 23:07:33 +00:00
2025-08-12 16:18:42 +00:00