aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/niri.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/niri.rs b/src/niri.rs
index a276b643..328f4aae 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -1236,20 +1236,22 @@ impl Niri {
fn redraw(&mut self, backend: &mut Backend, output: &Output) {
let _span = tracy_client::span!("Niri::redraw");
+ let state = self.output_state.get_mut(output).unwrap();
+ assert!(matches!(
+ state.redraw_state,
+ RedrawState::Queued(_) | RedrawState::WaitingForEstimatedVBlankAndQueued(_)
+ ));
+
if !backend.is_active() {
+ state.redraw_state = RedrawState::Idle;
return;
}
let Some(renderer) = backend.renderer() else {
+ state.redraw_state = RedrawState::Idle;
return;
};
- let state = self.output_state.get_mut(output).unwrap();
- assert!(matches!(
- state.redraw_state,
- RedrawState::Queued(_) | RedrawState::WaitingForEstimatedVBlankAndQueued(_)
- ));
-
let presentation_time = state.frame_clock.next_presentation_time();
// Update from the config and advance the animations.