aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-08-11 08:28:01 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-08-11 08:28:01 +0400
commitf9c7fe4112e91754d6866f105384eb12f27aa5eb (patch)
treef8eae7b6276ba093856be8487cd2e01bca6a80bf /src/main.rs
parent3959d1eaa10f97f2377f8174b711c8c30a2f3949 (diff)
downloadniri-f9c7fe4112e91754d6866f105384eb12f27aa5eb.tar.gz
niri-f9c7fe4112e91754d6866f105384eb12f27aa5eb.tar.bz2
niri-f9c7fe4112e91754d6866f105384eb12f27aa5eb.zip
Move periodic tasks to event loop closure
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index d259b4a0..d89dcab1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -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();
}