Repository navigation
Add a native-content overlay plane on Windows - #15
Merged
Merged
Conversation
Windows now implements enable_scene_overlay and draw_layered. Deferred content (menus, tooltips, prompts) draws into a second composition swap chain above a native layer, so embedded surfaces like WebView2 sit between the base UI and the overlays. Frames with nothing deferred skip the overlay entirely. Also adds Window::native_composition to expose the DirectComposition device and layer, and moves keyboard focus back from native children when GPUI content is pressed.
Recovery decided whether to re-enable the overlay from the overlay itself, which an earlier failed retry had already dropped, so a retried recovery silently lost it (and the embedded WebView with it). Track the request instead and fail the attempt if re-enabling fails, so the retry loop covers it. NativeComposition handles are released on device loss; document that they are valid only for one generation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wingleeio
approved these changes
Oct 8, 2026
wingleeio
left a comment
Contributor
There was a problem hiding this comment.
Security-audited (no new deps, network, file/process access; core changes additive with no-op defaults off Windows) and reviewed. Pushed 9136322: device-lost recovery now restores the overlay from a persistent request flag (a retried recovery previously dropped it for good) and NativeComposition docs state handles are valid per generation. Renderer tests green. Follow-up worth considering: the overlay duplicates the per-window path/MSAA intermediates (~260 MB at 4K) — the two planes draw sequentially and could share them.
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.
Windows now implements enable_scene_overlay and draw_layered. Deferred content (menus, tooltips, prompts) draws into a second composition swap chain above a native layer, so embedded surfaces like WebView2 sit between the base UI and the overlays. Frames with nothing deferred skip the overlay entirely.
Also adds Window::native_composition to expose the DirectComposition device and layer, and moves keyboard focus back from native children when GPUI content is pressed. Overlay backdrop blurs sample the base frame, so frosted popovers still blur the UI beneath them.
Used by Zeron's Windows browser (WebView2 in visual-hosting mode).
Tested with cargo test -p gpui_windows --lib and in Zeron on Windows 10.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.