mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Move refresh calls into State
This commit is contained in:
+1
-14
@@ -111,19 +111,6 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
event_loop
|
event_loop
|
||||||
.run(None, &mut state, move |state| {
|
.run(None, &mut state, |state| state.refresh_and_flush_clients())
|
||||||
let _span = tracy_client::span!("loop callback");
|
|
||||||
|
|
||||||
// These should be called periodically, before flushing the clients.
|
|
||||||
state.niri.layout.refresh();
|
|
||||||
state.niri.refresh_pointer_outputs();
|
|
||||||
state.niri.popups.cleanup();
|
|
||||||
state.update_focus();
|
|
||||||
|
|
||||||
{
|
|
||||||
let _span = tracy_client::span!("flush_clients");
|
|
||||||
state.niri.display_handle.flush_clients().unwrap();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
+15
@@ -223,6 +223,21 @@ impl State {
|
|||||||
Self { backend, niri }
|
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>) {
|
pub fn move_cursor(&mut self, location: Point<f64, Logical>) {
|
||||||
let under = self.niri.surface_under_and_global_space(location);
|
let under = self.niri.surface_under_and_global_space(location);
|
||||||
let pointer = &self.niri.seat.get_pointer().unwrap();
|
let pointer = &self.niri.seat.get_pointer().unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user