Skip to content

fix(windows): resolve gpui windows build#3

Merged
BumpyClock merged 3 commits into
mainfrom
fix/windows-build-gpui-component
Jun 10, 2026
Merged

fix(windows): resolve gpui windows build#3
BumpyClock merged 3 commits into
mainfrom
fix/windows-build-gpui-component

Conversation

@BumpyClock

Copy link
Copy Markdown
Owner

This pull request makes minor code improvements to the gpui_windows crate, focusing on import style consistency and a small refactor for clarity. The changes do not affect functionality but improve code readability and maintainability.

Codebase consistency and clarity:

  • Updated import statements for ResultExt to use an absolute path (::util::ResultExt) in both direct_manipulation.rs and util.rs for consistency and to avoid ambiguity. [1] [2]
  • Refactored DirectXRenderer::update_retained_layer_cache in directx_renderer.rs to store the result of supports_retained_layer_scene(scene) in a variable, improving readability and preventing duplicate function calls. [1] [2]Disambiguate external util imports and avoid borrowing the renderer immutably while direct composition is mutably borrowed.

Disambiguate external util imports and avoid borrowing the renderer immutably while direct composition is mutably borrowed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 25f83497-10dd-4e3c-8a82-483c3a779d75

📥 Commits

Reviewing files that changed from the base of the PR and between cb6e2c5 and b5cfaa9.

📒 Files selected for processing (10)
  • crates/gpui/examples/rounded_blur_overlay.rs
  • crates/gpui/src/platform.rs
  • crates/gpui_linux/src/linux/wayland/window.rs
  • crates/gpui_macos/src/window.rs
  • crates/gpui_windows/Cargo.toml
  • crates/gpui_windows/src/direct_manipulation.rs
  • crates/gpui_windows/src/directx_renderer.rs
  • crates/gpui_windows/src/events.rs
  • crates/gpui_windows/src/util.rs
  • crates/gpui_windows/src/window.rs

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


Summary by CodeRabbit

  • New Features

    • Native rounded blur/backdrop support on Windows with controls to enable/update rounded clipping; rounded-blur example app added.
    • Rounded-corner blur support added on macOS and Wayland (rounded-region approximation) to preserve clipped blur visuals.
  • Bug Fixes

    • Accessibility-initiated clicks now invoke element click handlers when appropriate (synthesizes a keyboard-style click).
    • Some accessibility "Click" actions are now treated as unhandled (debug-logged) instead of synthesizing mouse events.
  • Refactor

    • Minor import/path and rendering-call optimizations.
  • Tests

    • Updated unit and integration tests for rounded-region logic and accessibility-initiated clicks.
  • Documentation

    • Expanded docs for blurred background appearance including corner-radius semantics.

Walkthrough

Add Windows rounded-host-backdrop blur support and renderer APIs; wire blur updates into window sizing and events; move AccessKit Click handling into paint-time handler registration (synthesizing a keyboard ClickEvent) and remove Window-level Click synthesis; standardize a couple import paths and add an example and platform-specific rounded-blur implementations.

Changes

Windows graphics maintenance & small optimizations

Layer / File(s) Summary
Import path & Cargo change
crates/gpui_windows/src/direct_manipulation.rs, crates/gpui_windows/src/util.rs, crates/gpui_windows/Cargo.toml
Standardize ResultExt imports to absolute (::util::ResultExt) and explicitly select windows crate features while keeping workspace=true.
Renderer retained-layer cache
crates/gpui_windows/src/directx_renderer.rs
Cache the result of supports_retained_layer_scene(scene) in update_retained_layer_cache and reuse it for the subsequent branch.

Windows rounded host-backdrop blur

Layer / File(s) Summary
Composition imports & renderer state
crates/gpui_windows/src/directx_renderer.rs
Add DispatcherQueue/Composition imports and extend DirectXRenderer with rounded-backdrop state fields; initialize rounded-backdrop state disabled.
Device-loss handling & recreate
crates/gpui_windows/src/directx_renderer.rs
Tear down rounded-backdrop resources on reset and rebuild them when recreating renderer state after device loss.
Transparency path & public APIs
crates/gpui_windows/src/directx_renderer.rs
Make update_transparency a no-op when rounded-backdrop is active; add set_rounded_backdrop_blur and update_rounded_backdrop APIs and supporting rebuild logic.
RoundedBackdrop type & DispatcherQueue helper
crates/gpui_windows/src/directx_renderer.rs
Add lazy per-thread DispatcherQueue initializer and RoundedBackdrop type that constructs and updates the Composition visual tree.
Window integration & events
crates/gpui_windows/src/window.rs, crates/gpui_windows/src/events.rs
Wire renderer rounded-backdrop updates into set_background_appearance and handle_size_change, refine DWM corner logic, and adjust accent policy handling for blur/host-backdrop cases.

Accessibility click handling (A11y)

Layer / File(s) Summary
Paint computes node id & register AccessKit Click
crates/gpui/src/elements/div.rs
Compute current_a11y_node_id during Interactivity::paint, forward it into paint_mouse_listeners, and register an AccessKit Action::Click handler that synthesizes a keyboard Enter ClickEvent to invoke existing click_listeners.
Tests & Window action change
crates/gpui/src/elements/div.rs, crates/gpui/src/window.rs
Replace/reshape a11y test to assert an A11y-initiated click invokes the click handler without a mouse event; remove accesskit::Action::Click from Window::handle_a11y_action so Click falls through to the default/unhandled path.

Cross-platform rounded blur behavior and example

Layer / File(s) Summary
Platform API and unit test
crates/gpui/src/platform.rs
Change WindowBackgroundAppearance::Blurred to Blurred { corner_radius: Pixels } and add a test to ensure conversions preserve the corner radius setting.
Wayland rounded-region rebuild & tests
crates/gpui_linux/src/linux/wayland/window.rs
Trigger blur-region rebuild on resize for blurred backgrounds with corner radius; implement rounded_rect_region_bands to approximate rounded-rect by horizontal bands and add unit tests.
macOS rounded masking
crates/gpui_macos/src/window.rs
Track blur overlay corner radius, apply a rounded-rect mask to NSVisualEffectView when radius > 0, rebuild mask only when radius changes, and add helper code to create rounded-rect mask images.
Rounded blur overlay example
crates/gpui/examples/rounded_blur_overlay.rs
Add an example RoundedBlurOverlay implementing a pill-shaped rounded blur overlay using WindowBackgroundAppearance::Blurred { corner_radius }.

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs:

  • BumpyClock/gpui#2: Related prior work touching AccessKit integration and the same a11y codepaths (div.rs and window.rs).
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(windows): resolve gpui windows build' is partially related to the changeset. It refers to fixing a Windows build issue, which aligns with the import consistency and refactoring changes in gpui_windows, but it is overly broad and does not clearly summarize the specific improvements made (import path updates and refactoring for clarity).
Description check ✅ Passed The description is directly related to the changeset. It explains the import updates and refactoring changes in gpui_windows, matching the file-level summaries provided, though it doesn't mention all changes across all files in the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-build-gpui-component

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a Windows build issue in the gpui_windows crate by resolving a Rust borrow-checker conflict in DirectXRenderer::update_retained_layer_cache and by disambiguating util::ResultExt imports to explicitly target the external util crate.

Changes:

  • Prevents simultaneous mutable/immutable borrowing of DirectXRenderer by computing supports_retained_layer_scene(scene) before mutably borrowing self.direct_composition.
  • Updates ResultExt imports to ::util::ResultExt in the touched modules to make the external-crate intent explicit and avoid name resolution ambiguity.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
crates/gpui_windows/src/util.rs Switches ResultExt import to ::util::ResultExt to explicitly reference the external util crate.
crates/gpui_windows/src/directx_renderer.rs Fixes borrow-checker conflict by caching supports_retained_layer_scene(scene) before mutably borrowing direct_composition.
crates/gpui_windows/src/direct_manipulation.rs Switches ResultExt import to ::util::ResultExt to explicitly reference the external util crate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

BumpyClock and others added 2 commits June 9, 2026 20:29
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sh support

Implement HostBackdropBrush-style blur across Windows (WinComp), Linux (Wayland/kwin), and macOS (NSVisualEffectView) backends. Includes rounded_blur_overlay example demonstrating the feature.
@BumpyClock
BumpyClock merged commit 510dedc into main Jun 10, 2026
3 of 4 checks passed
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.

2 participants