mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +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) {
|
fn redraw(&mut self, backend: &mut Backend, output: &Output) {
|
||||||
let _span = tracy_client::span!("Niri::redraw");
|
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();
|
let state = self.output_state.get_mut(output).unwrap();
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
state.redraw_state,
|
state.redraw_state,
|
||||||
RedrawState::Queued(_) | RedrawState::WaitingForEstimatedVBlankAndQueued(_)
|
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();
|
let presentation_time = state.frame_clock.next_presentation_time();
|
||||||
|
|
||||||
// Update from the config and advance the animations.
|
// Update from the config and advance the animations.
|
||||||
|
|||||||
Reference in New Issue
Block a user