Fix high-signal widget and Wayland warnings

Avoid recursive operation traversal, execute visible list updates instead of leaving a lazy iterator unused, remove unreachable cfg-gated surface creation code, and handle subsurface buffer attachment failures.
This commit is contained in:
Votre Nom 2026-05-05 08:27:03 +02:00 committed by Lionel DARNIS
parent f1f42f2bff
commit ce5ea665e2
3 changed files with 10 additions and 4 deletions

View file

@ -601,7 +601,7 @@ pub fn visible_bounds(id: Id) -> Task<Option<Rectangle>> {
operate: &mut dyn FnMut(&mut dyn Operation<Option<Rectangle>>),
) {
self.depth += 1;
self.traverse(operate);
operate(self);
self.depth -= 1;
}

View file

@ -153,9 +153,12 @@ impl PlatformSpecific {
) -> Option<Box<dyn HasWindowHandle + Send + Sync + 'static>> {
#[cfg(all(feature = "cctk", target_os = "linux"))]
{
return self.wayland.create_surface();
self.wayland.create_surface()
}
#[cfg(not(all(feature = "cctk", target_os = "linux")))]
{
None
}
None
}
pub(crate) fn update_surface_shm(

View file

@ -409,7 +409,10 @@ impl SubsurfaceState {
.unwrap();
canvas[0..width as usize * height as usize * 4].copy_from_slice(data);
surface.damage_buffer(0, 0, width as i32, height as i32);
buffer.attach_to(&surface);
if let Err(err) = buffer.attach_to(&surface) {
log::warn!("failed to attach shm buffer to subsurface: {err}");
return;
}
surface.offset(offset.x as i32, offset.y as i32);
wp_viewport.set_destination(
(width as f64 / scale) as i32,