Move refresh calls into State

This commit is contained in:
Ivan Molodetskikh
2023-10-10 07:55:31 +04:00
parent 189d1bd97b
commit 2508d3e08e
2 changed files with 16 additions and 14 deletions
+15
View File
@@ -223,6 +223,21 @@ impl State {
Self { backend, niri }
}
pub fn refresh_and_flush_clients(&mut self) {
let _span = tracy_client::span!("refresh_and_flush_clients");
// These should be called periodically, before flushing the clients.
self.niri.layout.refresh();
self.niri.refresh_pointer_outputs();
self.niri.popups.cleanup();
self.update_focus();
{
let _span = tracy_client::span!("flush_clients");
self.niri.display_handle.flush_clients().unwrap();
}
}
pub fn move_cursor(&mut self, location: Point<f64, Logical>) {
let under = self.niri.surface_under_and_global_space(location);
let pointer = &self.niri.seat.get_pointer().unwrap();