iced: Optimize updates

This commit is contained in:
Victoria Brekenfeld 2025-04-24 19:00:01 +02:00 committed by Victoria Brekenfeld
parent 7c222ae6d1
commit 0be83fe930
3 changed files with 21 additions and 20 deletions

View file

@ -635,9 +635,12 @@ impl SpaceElement for CosmicWindow {
}
#[profiling::function]
fn refresh(&self) {
SpaceElement::refresh(&self.0);
if self.0.with_program(|p| {
SpaceElement::refresh(&p.window);
if !p.has_ssd(true) {
return false;
}
let title = p.window.title();
let mut last_title = p.last_title.lock().unwrap();
if *last_title != title {
@ -648,6 +651,8 @@ impl SpaceElement for CosmicWindow {
}
}) {
self.0.force_update();
} else {
SpaceElement::refresh(&self.0);
}
}
}