Fix compositor output routing and pointer hints; format imports

This commit is contained in:
Samuel Onoja committed 2026-09-30 06:39:58 +01:00
1 parent 88e4f3c135
commit 46509f880a
108 files changed
+3682 -8371

No files matched your search

+7 -22
View File
@@ -1,7 +1,5 @@
use std::{
collections::VecDeque,
time::{Duration, Instant},
};
use std::collections::VecDeque;
use std::time::{Duration, Instant};
use smithay::utils::{Physical, Rectangle};
@@ -94,14 +92,8 @@ impl RenderMetrics {
.unwrap_or(0);
self.frame_times.make_contiguous().sort_unstable();
let percentile = |percent: usize| {
let index = (self.frame_times.len() * percent)
.div_ceil(100)
.saturating_sub(1);
self.frame_times
.get(index)
.copied()
.unwrap_or_default()
.as_micros()
let index = (self.frame_times.len() * percent).div_ceil(100).saturating_sub(1);
self.frame_times.get(index).copied().unwrap_or_default().as_micros()
};
tracing::info!(
target: "ferese::render",
@@ -131,8 +123,7 @@ impl RenderMetrics {
}
fn rectangle_area(rectangle: &Rectangle<i32, Physical>) -> u64 {
u64::try_from(rectangle.size.w.max(0)).unwrap_or(0)
* u64::try_from(rectangle.size.h.max(0)).unwrap_or(0)
u64::try_from(rectangle.size.w.max(0)).unwrap_or(0) * u64::try_from(rectangle.size.h.max(0)).unwrap_or(0)
}
#[cfg(test)]
@@ -211,14 +202,8 @@ mod tests {
for micros in 0..600 {
metrics.record_frame(Duration::from_micros(micros), &[], 0, FrameEffectMetrics);
}
assert_eq!(
metrics.frame_times.front(),
Some(&Duration::from_micros(88))
);
assert_eq!(
metrics.frame_times.back(),
Some(&Duration::from_micros(599))
);
assert_eq!(metrics.frame_times.front(), Some(&Duration::from_micros(88)));
assert_eq!(metrics.frame_times.back(), Some(&Duration::from_micros(599)));
assert!(
metrics
.frame_times