Skip to content

fix: reduce macOS idle CPU when window is hidden#2202

Open
Code-newWorld wants to merge 1 commit into
chen08209:mainfrom
Code-newWorld:fix-macos-idle-cpu-followup
Open

fix: reduce macOS idle CPU when window is hidden#2202
Code-newWorld wants to merge 1 commit into
chen08209:mainfrom
Code-newWorld:fix-macos-idle-cpu-followup

Conversation

@Code-newWorld

Copy link
Copy Markdown

Summary

Follow-up to #2201 (tray-title dedup). Remaining idle-CPU reductions when the window is hidden:

  • Pause per-second updateRunTime / updateTraffic core IPC while Render.isPaused and showTrayTitle is off
  • Skip parsing TUN request push events while the window is hidden
  • Stop logging every getTraffic / getTotalTraffic invoke

These are independent of the tray setTitle fix in #2201 / #1644.

Test plan

  • Window hidden, tray title off, TUN on: CPU stays low
  • Re-show window: runtime/traffic and connections UI update again within ~1s
  • With tray title on while hidden: traffic polling still runs for the tray
  • Proxy still works while hidden

Supersedes the non-tray parts of #2186.

Follow-up to tray-title dedup (chen08209#2201 / chen08209#1644):

- Expose Render.isPaused and skip per-second runtime/traffic IPC while
  the window is hidden and the tray title is off
- Skip TUN request-event JSON parsing while the window is hidden
- Silence getTraffic/getTotalTraffic invoke logs that flood every second

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant