fix(gpui): restore Windows/Linux build — sync_native_surface signature

Commit 3678db6 added a `corner_radii: Corners<Pixels>` parameter to the
`PlatformWindow::sync_native_surface` trait method (and to the macOS impl
and the `native_surface` element call site) to clip the overlay to the
panel's rounded corners, but left the Windows, X11, and Wayland impls at
the old 2-argument signature. A 2-arg method in an `impl PlatformWindow`
block against a 3-arg trait method is an E0050 compile error, so the
workspace no longer built on Windows, X11, or Wayland — only macOS, which
is the sole CI runner, so it went unnoticed. This breaks the project's
explicit macOS/Windows/Linux requirement.

Align all three impls to the trait by accepting `_corner_radii`. Bodies
are unchanged: those platforms position/size the child surface exactly as
before and do not clip its corners (the pre-3678db6 behaviour on every
platform — not a regression; per-platform corner clipping can land later).
Verified: signatures now match the trait (`crate::Corners<Pixels>`, the
same path the trait uses), rustfmt parses all three files, and the macOS
build is unaffected (cargo check -p ely_app clean). Windows/Linux cannot
be compile-checked on this macOS host (their C deps need the platform SDK),
but the fix is a type-level signature alignment to a known trait.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-29 14:23:15 -04:00
co-authored by Claude Opus 4.8
parent d150da5bd0
commit 12565eabc7
3 changed files with 18 additions and 3 deletions
+6 -1
View File
@@ -1084,7 +1084,12 @@ impl PlatformWindow for WaylandWindow {
)) ))
} }
fn sync_native_surface(&self, surface: &crate::NativeSurfaceHandle, bounds: Bounds<Pixels>) { fn sync_native_surface(
&self,
surface: &crate::NativeSurfaceHandle,
bounds: Bounds<Pixels>,
_corner_radii: crate::Corners<Pixels>,
) {
let state = self.borrow(); let state = self.borrow();
let bounds = bounds.to_device_pixels(state.scale); let bounds = bounds.to_device_pixels(state.scale);
if let Some(native_surface) = state.native_surfaces.get(&surface.identity()) { if let Some(native_surface) = state.native_surfaces.get(&surface.identity()) {
+6 -1
View File
@@ -1521,7 +1521,12 @@ impl PlatformWindow for X11Window {
)) ))
} }
fn sync_native_surface(&self, surface: &NativeSurfaceHandle, bounds: Bounds<Pixels>) { fn sync_native_surface(
&self,
surface: &NativeSurfaceHandle,
bounds: Bounds<Pixels>,
_corner_radii: crate::Corners<Pixels>,
) {
let state = self.0.state.borrow(); let state = self.0.state.borrow();
let bounds = bounds.to_device_pixels(state.scale_factor); let bounds = bounds.to_device_pixels(state.scale_factor);
drop(state); drop(state);
+6 -1
View File
@@ -871,7 +871,12 @@ impl PlatformWindow for WindowsWindow {
Some(NativeSurfaceHandle::from_win32_hwnd(hwnd.0 as isize)) Some(NativeSurfaceHandle::from_win32_hwnd(hwnd.0 as isize))
} }
fn sync_native_surface(&self, surface: &NativeSurfaceHandle, bounds: Bounds<Pixels>) { fn sync_native_surface(
&self,
surface: &NativeSurfaceHandle,
bounds: Bounds<Pixels>,
_corner_radii: crate::Corners<Pixels>,
) {
let bounds = bounds.to_device_pixels(self.scale_factor()); let bounds = bounds.to_device_pixels(self.scale_factor());
let hwnd = HWND(surface.win32_hwnd() as _); let hwnd = HWND(surface.win32_hwnd() as _);
unsafe { unsafe {