mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Set redraw state to idle on early returns
Haven't hit any problems due to this yet, but I suspect that it's possible.
This commit is contained in:
+10
-8
@@ -1236,20 +1236,22 @@ impl Niri {
|
||||
fn redraw(&mut self, backend: &mut Backend, output: &Output) {
|
||||
let _span = tracy_client::span!("Niri::redraw");
|
||||
|
||||
if !backend.is_active() {
|
||||
return;
|
||||
}
|
||||
|
||||
let Some(renderer) = backend.renderer() else {
|
||||
return;
|
||||
};
|
||||
|
||||
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 presentation_time = state.frame_clock.next_presentation_time();
|
||||
|
||||
// Update from the config and advance the animations.
|
||||
|
||||
Reference in New Issue
Block a user