1
0
Fork 0
forked from wry/wry

renderer: fix rendering flickering window rendering

This commit is contained in:
kossLAN 2026-04-11 00:57:16 -04:00
parent bd3128c516
commit 4e9b6def83
No known key found for this signature in database
3 changed files with 108 additions and 41 deletions

View file

@ -215,6 +215,9 @@ impl Renderer<'_> {
};
}
render_stacked!(self.state.root.stacked);
// Flush RoundedFillRect ops from container/float borders so they don't
// sort after (and render on top of) layer-shell CopyTexture ops.
self.base.sync();
if fullscreen.is_none() {
render_layer!(output.layers[2]);
}
@ -289,7 +292,7 @@ impl Renderer<'_> {
let bar_height = tab_bar.height;
let render_scale = tab_bar.render_scale;
// Vulkan sorts ops: Fill < Tex < RoundedFill (by z_order, color) < RoundedTex.
// Vulkan sorts ops: Fill < RoundedFill (by z_order, color) < Tex/RoundedTex (by index).
// We use:
// FillRect tiny strip for Vulkan paint regions (hidden)
// RoundedFillRect z0 solid rounded bg
@ -466,6 +469,7 @@ impl Renderer<'_> {
.node
.node_render(self, x + content.x1(), y + content.y1(), Some(&body));
self.stretch = None;
self.corner_radius = None;
} else {
let gap = self.state.theme.sizes.gap.get();
let (srgb_srgb, bw, border_color, focused_border_color) = if gap != 0 {
@ -545,6 +549,7 @@ impl Renderer<'_> {
.node
.node_render(self, x + content.x1(), y + content.y1(), Some(&body));
self.stretch = None;
self.corner_radius = None;
}
}
@ -630,6 +635,9 @@ impl Renderer<'_> {
is_subsurface: bool,
) {
let stretch = self.stretch.take();
// Take corner_radius early so it is never leaked on early return
// and so that below-subsurfaces cannot steal it from the main surface.
let corner_radius = self.corner_radius.take();
let children = surface.children.borrow();
let buffer = match surface.buffer.get() {
Some(b) => b,
@ -680,9 +688,12 @@ impl Renderer<'_> {
};
}
render!(&children.below);
// Restore corner_radius only for the main surface's render_buffer call.
self.corner_radius = corner_radius;
self.render_buffer(surface, &buffer, x, y, tpoints, size, bounds);
render!(&children.above);
} else {
self.corner_radius = corner_radius;
self.render_buffer(surface, &buffer, x, y, tpoints, size, bounds);
}
}
@ -827,6 +838,7 @@ impl Renderer<'_> {
self.corner_radius = Some(inner_cr);
}
child.node_render(self, body.x1(), body.y1(), Some(&scissor_body));
self.corner_radius = None;
}
pub fn render_layer_surface(&mut self, surface: &ZwlrLayerSurfaceV1, x: i32, y: i32) {