Speed up per-frame layout, hit testing, and stacking paths

Split ScrollingLayout validation so the per-frame geometry solve only
checks scalars and keeps the full tree validation behind debug_assert,
removing a HashSet build from every frame. Replace the per-region Vec
in decode_regions with a stack array via as_chunks, and skip the window
hit test in PointerMotion when Overview is not presenting, where
visual_scale_for_window returns 1.0 regardless.

Guard sync_window_stacking behind a check that the space already matches
the target order with uniform z_index, avoiding an O(n^2) raise_element
loop on every redraw. Narrow window_under_visual to the space iterator
outside Overview, keeping the collected and sorted candidate list for
the Overview branch where front-to-back order is load-bearing.

Raise rust-version to 1.98 and clear the resulting Clippy findings
across the workspace: let-chain collapses, clamp, and while-let loops.
This commit is contained in:
Samuel Onoja committed 2026-09-29 09:49:04 +01:00
1 parent 391f6b4e37
commit 67192c0c04
25 files changed
+886 -700

No files matched your search

+13 -15
View File
@@ -74,14 +74,12 @@ impl Ferese {
.space
.outputs()
.all(|output| self.session_lock.presented.contains(output))
&& let Some(confirmation) = self.session_lock.confirmation.take()
&& confirmation.ext_session_lock().is_alive()
{
if let Some(confirmation) = self.session_lock.confirmation.take() {
if confirmation.ext_session_lock().is_alive() {
confirmation.lock();
self.session_lock.confirmed = true;
tracing::info!("session lock confirmed after safe output frames");
}
}
confirmation.lock();
self.session_lock.confirmed = true;
tracing::info!("session lock confirmed after safe output frames");
}
}
@@ -163,14 +161,14 @@ impl SessionLockHandler for Ferese {
}
fn new_surface(&mut self, surface: LockSurface, output: WlOutput) {
if let Some(output) = Output::from_resource(&output) {
if let Some(geometry) = self.space.output_geometry(&output) {
surface.with_pending_state(|state| {
state.size = Some((geometry.size.w as u32, geometry.size.h as u32).into())
});
self.session_lock.surfaces.insert(output, surface);
self.focus_lock_surface();
}
if let Some(output) = Output::from_resource(&output)
&& let Some(geometry) = self.space.output_geometry(&output)
{
surface.with_pending_state(|state| {
state.size = Some((geometry.size.w as u32, geometry.size.h as u32).into())
});
self.session_lock.surfaces.insert(output, surface);
self.focus_lock_surface();
}
}
}