Update TopBar For Windows - #5446
Conversation
|
New commits were pushed, so this pull request left the human review queue and is back to waiting-for-author. Comment |
|
/ai-review |
Submission reviewNote: This review was done by Claude. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Remember: The AI reviewer can be wrong - it may misread code, flag correct code as broken, or suggest changes that make things worse. Treat its findings as suggestions to verify, not instructions to follow blindly. You're responsible for the code you submit, so if a finding doesn't hold up, say so instead of changing working code to satisfy it. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. The new Resource Monitor is the main source of findings — its sampling path is shared mutable state reached from several concurrent one-second workers, and some of it runs on the XAML UI thread. 1. The resource samplers race on shared PDH state (crash potential). Two independent one-second timers each spawn their own worker that samples the same PDH handles:
Neither timer waits for the previous worker, and
Simplest fix: put the whole sampling path behind one mutex (the same one 2. Blocking WMI / COM / WLAN calls on the XAML UI thread. The bar freezes for as long as these take. The Display/Wi-Fi/Bluetooth buttons already use the right pattern (
Move the data gathering into the existing 3. The window-event hook subscribes to a much wider range than it uses. g_windowEventHook = SetWinEventHook(EVENT_OBJECT_CREATE, EVENT_OBJECT_NAMECHANGE, ...); // line 8417That range is 4. Per-second work that should be change-driven.
Separately, 5. winrt::com_ptr<IDXGIAdapter1> adapter;
for (UINT i = 0; factory->EnumAdapters1(i, adapter.put()) != DXGI_ERROR_NOT_FOUND; ++i) { // lines 848, 879
6. Bluetooth enumeration does a GATT battery read for every device.
Optional improvements
Cleanliness items — none of these affect users, so it's your call.
Functionality notes
Non-critical observations about the feature behaviour itself.
Next steps:
See the review process for details. |
|
/ready-for-reviewer |
|
New commits were pushed, so this pull request left the human review queue and is back to waiting-for-author. Comment |
|
/ai-review |
Submission reviewNote: This review was done by Claude. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Remember: The AI reviewer can be wrong - it may misread code, flag correct code as broken, or suggest changes that make things worse. Treat its findings as suggestions to verify, not instructions to follow blindly. You're responsible for the code you submit, so if a finding doesn't hold up, say so instead of changing working code to satisfy it. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. The tool-mod boilerplate matches the wiki snippet verbatim, the settings block and 1. A new OS thread is created every second, forever. Use one long-lived sampler thread that waits on 2. Blocking WMI / WLAN / COM calls still run on the XAML UI thread. Some paths were moved to workers in this PR (the Display, Wi-Fi and Bluetooth flyout-open handlers), but several equivalents weren't, and they freeze the whole bar for as long as the query takes — WMI in particular routinely takes hundreds of milliseconds to seconds on its first use in a process:
3. SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
reinterpret_cast<LPARAM>(L"ImmersiveColorSet"), SMTO_ABORTIFHUNG, 200,
&result);The 200 ms timeout is per window, and this runs inside the dark-mode tile's 4. Task-button icons are re-extracted from disk on every title change. Optional improvements
Minor polish — none of this affects users, so it's your call. Dead code. There's a fair amount of it, and some of it has comments that describe behavior the code doesn't have — worth a sweep, especially since the changelog mentions AI assistance:
Unused includes / link libraries.
Also, the teardown block at lines 8802–8840 releases only some of the Teardown race on the cached endpoint volume. Line 8839 does Stray call in Shared flags across threads. Style resolution cost.
Functionality notes
Non-critical observations and ideas about the feature behavior itself. Single click is now delayed by The bar is kept visible by a combination of guards plus a 1 s poll.
GPU usage is the busiest single engine.
Next steps:
See the review process for details. |
|
/ready-for-reviewer |
Changelog
If this pull request updates an existing mod, describe the changes below:
Mod authorship
If this pull request introduces a new mod, please complete the section below.
This mod was created by:
Please select the options that best apply. Your selection does not affect the acceptance criteria, but it helps reviewers understand the context of the code and provide relevant feedback.