Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
fix: scale the surface-clip corner radius with the window
render_finish set the scenefx corner radius on surfaces.tree (and the
window_background rect) in logical units while the surface content is
scaled to its dest size — so zoomed-out cce windows kept zoom-1-sized
corner cuts (the clients' own drawn corners shrink with the buffer, but
the larger unscaled clip dominated). Both now scale by the window scale
like the blur radius set a few lines above; draw_borders already wrote
the background rect scaled, so this also removes the last unscaled
writer racing it.
Co-Authored-By: Claude Fable 5 <[email protected]>
src/server/window.rs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/server/window.rs b/src/server/window.rs
index ef894ad..d5541e7 100644
--- a/src/server/window.rs
+++ b/src/server/window.rs
@@ -1953,13 +1953,17 @@ impl Window {
self.update_shadow(width, height, radius, want_shadow);
ffi::river_scene_node_set_opacity(self.tree as *mut ffi::wlr_scene_node, requested.opacity);
+ // Device px, like the blur radius above: the surface content is
+ // scaled to its dest size, so an unscaled clip radius would keep
+ // cutting zoom-1-sized corners into a zoomed-down window (the
+ // clients' own drawn corners shrink with the buffer).
ffi::river_scene_node_set_corner_radius(
self.surfaces.tree as *mut ffi::wlr_scene_node,
- radius,
+ (radius as f64 * self.scale) as i32,
);
ffi::river_scene_rect_set_corner_radius(
self.window_background,
- radius,
+ (radius as f64 * self.scale) as i32,
);
struct ScaleData {