Fix high-signal widget and Wayland warnings
Some checks are pending
Audit / vulnerabilities (push) Waiting to run
Check / wasm (push) Waiting to run
Check / widget (push) Waiting to run
Document / all (push) Waiting to run
Format / all (push) Waiting to run
Lint / all (push) Waiting to run
Test / all (macOS-latest, 1.88) (push) Waiting to run
Test / all (macOS-latest, beta) (push) Waiting to run
Test / all (macOS-latest, stable) (push) Waiting to run
Test / all (ubuntu-latest, 1.88) (push) Waiting to run
Test / all (ubuntu-latest, beta) (push) Waiting to run
Test / all (ubuntu-latest, stable) (push) Waiting to run
Test / all (windows-latest, 1.88) (push) Waiting to run
Test / all (windows-latest, beta) (push) Waiting to run
Test / all (windows-latest, stable) (push) Waiting to run
Some checks are pending
Audit / vulnerabilities (push) Waiting to run
Check / wasm (push) Waiting to run
Check / widget (push) Waiting to run
Document / all (push) Waiting to run
Format / all (push) Waiting to run
Lint / all (push) Waiting to run
Test / all (macOS-latest, 1.88) (push) Waiting to run
Test / all (macOS-latest, beta) (push) Waiting to run
Test / all (macOS-latest, stable) (push) Waiting to run
Test / all (ubuntu-latest, 1.88) (push) Waiting to run
Test / all (ubuntu-latest, beta) (push) Waiting to run
Test / all (ubuntu-latest, stable) (push) Waiting to run
Test / all (windows-latest, 1.88) (push) Waiting to run
Test / all (windows-latest, beta) (push) Waiting to run
Test / all (windows-latest, stable) (push) Waiting to run
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:
parent
f0c0b8d42e
commit
bb9115558d
4 changed files with 11 additions and 5 deletions
|
|
@ -601,7 +601,7 @@ pub fn visible_bounds(id: Id) -> Task<Option<Rectangle>> {
|
||||||
operate: &mut dyn FnMut(&mut dyn Operation<Option<Rectangle>>),
|
operate: &mut dyn FnMut(&mut dyn Operation<Option<Rectangle>>),
|
||||||
) {
|
) {
|
||||||
self.depth += 1;
|
self.depth += 1;
|
||||||
self.traverse(operate);
|
operate(self);
|
||||||
self.depth -= 1;
|
self.depth -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,7 @@ where
|
||||||
self.visible_elements
|
self.visible_elements
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.zip(&mut state.visible_layouts)
|
.zip(&mut state.visible_layouts)
|
||||||
.map(|(element, (index, layout, tree))| {
|
.for_each(|(element, (index, layout, tree))| {
|
||||||
element.as_widget_mut().update(
|
element.as_widget_mut().update(
|
||||||
tree,
|
tree,
|
||||||
event,
|
event,
|
||||||
|
|
|
||||||
|
|
@ -153,9 +153,12 @@ impl PlatformSpecific {
|
||||||
) -> Option<Box<dyn HasWindowHandle + Send + Sync + 'static>> {
|
) -> Option<Box<dyn HasWindowHandle + Send + Sync + 'static>> {
|
||||||
#[cfg(all(feature = "cctk", target_os = "linux"))]
|
#[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(
|
pub(crate) fn update_surface_shm(
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,10 @@ impl SubsurfaceState {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
canvas[0..width as usize * height as usize * 4].copy_from_slice(data);
|
canvas[0..width as usize * height as usize * 4].copy_from_slice(data);
|
||||||
surface.damage_buffer(0, 0, width as i32, height as i32);
|
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);
|
surface.offset(offset.x as i32, offset.y as i32);
|
||||||
wp_viewport.set_destination(
|
wp_viewport.set_destination(
|
||||||
(width as f64 / scale) as i32,
|
(width as f64 / scale) as i32,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue