render: cut per-frame cost with a fast clear and row fills

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I96cdacecbe2a55c42825006e84fede076a6a6964
This commit is contained in:
raf 2026-06-24 13:14:55 +03:00
commit 7254cbf381
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF
2 changed files with 33 additions and 14 deletions

View file

@ -6,7 +6,6 @@
use std::os::fd::OwnedFd;
use std::os::unix::process::ExitStatusExt;
use std::process::ExitCode;
use std::time::Duration;
use anyhow::Context;
use calloop::generic::Generic;
@ -105,9 +104,11 @@ pub fn run() -> anyhow::Result<ExitCode> {
exit_code: ExitCode::SUCCESS,
};
// Block until an event (PTY output, input, configure) arrives - every
// repaint is driven by one, so there is nothing to do on a timer.
while !app.exit {
event_loop
.dispatch(Duration::from_millis(16), &mut app)
.dispatch(None, &mut app)
.context("dispatch event loop")?;
if app.dirty {
app.draw();