Address review on the XDamage capture PR

- Viewer PLI/FIR: dedupe only while an IDR is pending; drop the 1 s gap so a lost IDR cannot block recovery.
- XShm: release the local mapping on every attach failure; mark the segment for removal in all cases.
- Damage events no longer defer an overdue capture.
- After idle, the next tick is one frame after now instead of now.
This commit is contained in:
ferstar authored and VallierDev committed 2026-10-15 08:22:14 +08:00
1 parent a870f7d041
commit 59a45e092b
3 files changed
+20 -47

No files matched your search

+5 -5
View File
@@ -214,10 +214,9 @@ fn run_damage(config: Config, mut capture: DamageCapture, units: mpsc::Sender<Ve
if stop.load(Ordering::Relaxed) { return Ok(()); }
let deadline = if dirty { next_tick } else { last_send + keepalive };
let wait = deadline.saturating_duration_since(Instant::now());
if capture.wait(wait.max(Duration::from_millis(1)))? {
dirty = true;
continue;
}
// A change marks the picture dirty and falls through, so a client that damages the root constantly
// cannot keep an overdue tick waiting.
if capture.wait(wait.max(Duration::from_millis(1)))? { dirty = true; }
let now = Instant::now();
if dirty && now < next_tick { continue; }
if !dirty && now < last_send + keepalive { continue; }
@@ -250,7 +249,8 @@ fn run_damage(config: Config, mut capture: DamageCapture, units: mpsc::Sender<Ve
let now = Instant::now();
if dirty {
// Keep the tick phase; after a long idle, restart the phase from now instead of bursting to catch up.
next_tick = (next_tick + frame_interval).max(now);
let next = next_tick + frame_interval;
next_tick = if next > now { next } else { now + frame_interval };
dirty = false;
}
last_send = now;