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

+8 -12
View File
@@ -158,13 +158,10 @@ impl Service {
let mut network = dbus_cache::Cache::new("org.freedesktop.NetworkManager");
let mut bluetooth = dbus_cache::Cache::new("org.bluez");
loop {
// A poll overlapping a write is discarded below. Wait for the
// write to finish before retrying instead of launching commands
// repeatedly while a slow control operation is still running.
let Some(before) = wait_for_poll(&polling) else {
break;
};
// A poll overlapping a write is discarded below. Wait for the
// write to finish before retrying instead of launching commands
// repeatedly while a slow control operation is still running.
while let Some(before) = wait_for_poll(&polling) {
let mut snapshot = poll(&mut system_bus, &mut session_bus);
snapshot.network = network.read(before, network::read);
snapshot.bluetooth = bluetooth.read(before, bluetooth::read);
@@ -186,16 +183,14 @@ impl Service {
});
thread::spawn(move || {
loop {
let first = match commands.recv() {
Ok(command) => command,
Err(_) => break,
};
while let Ok(first) = commands.recv() {
let mut pending = vec![first];
for command in commands.try_iter() {
pending.retain(|(_, action)| action.key() != command.1.key());
pending.push(command);
}
for (id, action) in pending {
{
let mut state = shared.0.lock().unwrap();
@@ -210,6 +205,7 @@ impl Service {
shared.1.notify_one();
}
}
shared.0.lock().unwrap().3 = true;
shared.1.notify_one();
});