张小白 and Max 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-12 12:39:27 -03:00
2025-08-11 17:24:48 +00:00
2025-07-21 17:48:07 +00:00
2025-08-10 21:57:55 +00:00
2025-08-12 13:12:58 +00:00
2025-08-07 20:26:19 -03:00
2025-08-12 12:17:48 +00:00
2025-08-12 12:39:27 -03:00
2025-08-08 15:34:36 -03:00
2025-08-05 18:16:47 +00:00
2025-07-11 23:20:35 +00:00
2025-08-06 09:01:06 +00:00
2025-07-10 19:25:10 +00:00
2025-08-08 15:34:36 -03:00
2025-08-10 21:57:55 +00:00
2025-08-11 17:24:48 +00:00
2025-07-29 13:24:34 -07:00
2025-08-07 10:52:54 -07:00
2025-07-09 08:57:03 +08:00
2025-07-03 14:22:28 +00:00
2025-07-22 11:55:24 -04:00
2025-08-05 18:16:47 +00:00
2025-07-22 18:20:48 +02:00
2025-07-21 13:44:51 +02:00
2025-08-05 00:37:22 +00:00
2025-08-08 09:49:36 +03:00
2025-08-08 16:40:41 -03:00
2025-08-07 01:28:41 +00:00
2025-08-07 01:28:41 +00:00
2025-08-11 15:34:34 +02:00
2025-08-08 14:17:18 +00:00
2025-08-08 15:34:36 -03:00
2025-08-06 15:28:18 -04:00
2025-08-05 23:11:43 +00:00
2025-08-04 13:49:41 +00:00
2025-08-07 18:27:29 +03:00
2025-08-09 11:42:30 +00:00
2025-08-06 18:10:17 -04:00
2025-08-11 16:50:24 +00:00
2025-06-15 19:51:04 +00:00
2025-07-06 14:52:16 +02:00
2025-07-12 15:56:05 +00:00
2025-08-10 15:23:27 -03:00
2025-06-25 09:42:30 +02:00
2025-08-08 15:34:36 -03:00
2025-08-10 18:01:54 +00:00
2025-08-07 18:27:29 +03:00
2025-08-07 18:27:29 +03:00
2025-08-08 15:34:36 -03:00
2025-08-08 23:26:38 +00:00
2025-07-10 21:08:43 +02:00
2025-08-04 07:12:02 +00:00
2025-07-01 20:02:12 +00:00
2025-07-15 11:07:29 +00:00
2025-08-05 23:46:57 +03:00
2025-08-08 15:34:36 -03:00
2025-08-07 22:14:25 +00:00
2025-07-02 21:14:33 -04:00
2025-08-08 18:32:13 -03:00
2025-08-11 17:22:19 +00:00
2025-08-06 10:53:20 +02:00
2025-08-11 15:09:38 +00:00
2025-08-08 01:39:32 +00:00
2025-08-11 15:09:38 +00:00
2025-08-07 10:52:54 -07:00
2025-06-17 20:26:27 +00:00
2025-08-12 11:28:47 -07:00
2025-08-12 05:08:58 +00:00
2025-07-11 21:01:09 -04:00
2025-08-11 07:20:03 +00:00
2025-08-09 22:12:23 -03:00
2025-07-10 19:25:10 +00:00
2025-07-17 09:22:04 +00:00
2025-07-02 21:14:33 -04:00
2025-06-18 16:01:28 +05:30
2025-07-02 21:14:33 -04:00
2025-08-11 15:09:38 +00:00
2025-08-04 07:12:02 +00:00
2025-08-08 12:43:53 +00:00
2025-08-12 16:04:51 +00:00
2025-08-08 05:04:30 +00:00
2025-08-04 16:22:18 +00:00
2025-08-12 17:26:56 +00:00
2025-08-05 16:36:08 +02:00
2025-07-25 09:36:43 -04:00
2025-08-11 09:59:41 +00:00
2025-07-02 21:14:33 -04:00
2025-08-06 00:02:26 +00:00
2025-07-02 21:14:33 -04:00
2025-08-04 16:22:18 +00:00
2025-08-09 15:25:47 -04:00
2025-08-05 00:37:22 +00:00
2025-07-17 14:25:55 +00:00
2025-07-08 14:34:57 +00:00
2025-08-08 15:34:36 -03:00
2025-08-06 10:44:15 -04:00
2025-08-10 19:32:25 +00:00
2025-08-07 23:35:41 +00:00
2025-07-16 11:44:08 -04:00
2025-06-27 14:31:31 -06:00
2025-08-05 18:15:30 -04:00
2025-07-08 11:23:36 -03:00
2025-07-29 15:31:54 +00:00
2025-08-06 00:02:26 +00:00
2025-07-24 15:24:53 +00:00
2025-08-12 14:33:46 +00:00
2025-08-08 14:32:58 +02:00
2025-06-27 14:31:31 -06:00
2025-08-07 13:40:12 +00:00
2025-08-11 15:09:38 +00:00
2025-08-08 15:34:36 -03:00
2025-07-30 10:29:03 +00:00
2025-08-10 21:57:55 +00:00
2025-08-08 15:34:36 -03:00
2025-08-04 18:19:42 -07:00
2025-08-07 13:24:29 +00:00
2025-08-07 23:07:33 +00:00
2025-08-04 16:22:18 +00:00
2025-08-08 15:34:36 -03:00
2025-08-06 00:02:26 +00:00
2025-08-12 17:53:19 +00:00
2025-07-31 17:31:12 +00:00
2025-08-08 15:34:36 -03:00
2025-07-04 00:57:43 +00:00
2025-08-08 15:34:36 -03:00
2025-07-09 05:28:25 +05:30
2025-08-05 00:37:22 +00:00
2025-08-07 18:27:29 +03:00
2025-06-17 14:39:45 +00:00
2025-07-02 21:14:33 -04:00
2025-07-02 21:14:33 -04:00
2025-07-08 14:57:37 +00:00
2025-08-04 11:58:31 -03:00
2025-08-04 16:22:18 +00:00
2025-08-11 10:31:13 +00:00
2025-08-09 23:48:58 +02:00
2025-08-07 13:24:29 +00:00
2025-08-08 21:17:19 +00:00
2025-07-18 16:55:03 +00:00
2025-08-08 15:34:36 -03:00
2025-08-11 21:10:14 +00:00
2025-08-12 13:36:28 +00:00
2025-08-11 16:33:21 +00:00
2025-08-07 11:50:11 -03:00
2025-07-30 23:03:53 +05:30
2025-08-12 13:36:28 +00:00
2025-06-13 06:32:29 +00:00
2025-06-25 13:26:41 +00:00
2025-08-12 11:13:36 -06:00
2025-06-18 21:26:12 +00:00
2025-06-09 13:11:57 +02:00
2025-07-30 00:09:14 +00:00
2025-07-30 00:09:14 +00:00
2025-08-08 15:34:36 -03:00
2025-08-12 12:10:53 +00:00
2025-08-05 00:37:22 +00:00
2025-07-15 15:35:50 -04:00
2025-08-12 16:18:42 +00:00
2025-07-30 21:48:24 +00:00
2025-08-12 06:47:54 +00:00
2025-08-08 23:26:38 +00:00
2025-07-29 23:01:03 +00:00