Move periodic tasks to event loop closure

This commit is contained in:
Ivan Molodetskikh
2023-08-11 08:28:01 +04:00
parent 3959d1eaa1
commit f9c7fe4112
2 changed files with 10 additions and 6 deletions
+10 -3
View File
@@ -105,9 +105,16 @@ fn main() {
event_loop
.run(None, &mut data, move |data| {
// niri is running.
let _span = tracy_client::span!("flush_clients");
data.display.flush_clients().unwrap();
let _span = tracy_client::span!("loop callback");
// These should be called periodically, before flushing the clients.
data.niri.space.refresh();
data.niri.popups.cleanup();
{
let _span = tracy_client::span!("flush_clients");
data.display.flush_clients().unwrap();
}
})
.unwrap();
}
-3
View File
@@ -225,9 +225,6 @@ impl Niri {
|_, _| Some(output.clone()),
)
});
self.space.refresh();
self.popups.cleanup();
}
}