Repository navigation
perf(desktop-gpui): let hidden windows and an idle target picker stop redrawing - #2594
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
@greptileai review |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two idle costs in the GPUI app on macOS: hidden windows kept their display link running, and the target picker repainted every overlay on every 80 ms poll even when nothing changed.
Hidden windows (macOS 27)
platform/macos_occlusion.rsORsNSWindowOcclusionStateVisible(0x2) into any non-zeroocclusionState, which is the macOS 26 repair for gpui's display-link gate. On macOS 27 an ordered-out window reports 0x2000 rather than 0 (a plainNSWindow/NSPanelreports 0x2000 when created, 0x2002 when shown and 0x2000 afterorderOut). The shim therefore told gpui every hidden window was visible, and each one kept aCVDisplayLinkwaking the main thread at the panel refresh rate. That includes the main window parked in the tray, the hidden helper window, and windows hidden for the picker.ordered_out_windows_keep_raw_state()iskern.osproductversionmajor >= 27. On macOS 26 and earlier the shim behaves exactly as onmain.show_native,order_front_nativeandshow_window_without_focusre-run gpui's occlusion handler after ordering the window in (the callkick_display_linkalready makes), so a reshow never depends on AppKit posting an occlusion change.Target picker (
target_overlay.rs)refresh_target_overlaysonly when the cursor's display, the hovered window (id and bounds), the mic meter fill or a fetched app icon changed.RecordingSessionand notifies when the phase changes. The device row's disabled state reads the phase and used to get updated by the constant repaint.repaintintarget_overlay.rs) instead of relying on the 80 ms repaint that used to cover them.Re-measured on
main(ada2be5ac), 2026-10-19Isolated
cap-gpuibuilds of main and this PR with the same profile, macOS 27, 120 Hz panel,proc_pid_rusageover 15 s after a 12 s settle, 3 interleaved rounds, medians:Measurements
Isolated
cap-gpuiperf builds, macOS 27.0, 120 Hz panel,proc_pid_rusagedeltas over 15 s after a 12 s settle, 3 interleaved rounds, medians:mainmain→ PRmain→ PRmain→ PRmain(SSIM 1.000).

Confidence Score: 5/5
The PR appears safe to merge; no actionable defects were found.Summary
This PR cuts idle drawing in hidden macOS windows and target pickers.
Reviews (3) · Last reviewed commit: "fix(desktop-gpui): repaint target overla..." · Reviewed by Greptile