iced: Optimize updates
This commit is contained in:
parent
7c222ae6d1
commit
0be83fe930
3 changed files with 21 additions and 20 deletions
|
|
@ -381,7 +381,6 @@ impl CosmicStack {
|
|||
if update {
|
||||
self.0
|
||||
.resize(Size::from((self.active().geometry().size.w, TAB_HEIGHT)));
|
||||
self.0.force_update();
|
||||
}
|
||||
|
||||
result
|
||||
|
|
@ -436,7 +435,6 @@ impl CosmicStack {
|
|||
if !matches!(result, MoveResult::Default) {
|
||||
self.0
|
||||
.resize(Size::from((self.active().geometry().size.w, TAB_HEIGHT)));
|
||||
self.0.force_update();
|
||||
}
|
||||
|
||||
result
|
||||
|
|
@ -1208,7 +1206,6 @@ impl SpaceElement for CosmicStack {
|
|||
})
|
||||
}
|
||||
fn refresh(&self) {
|
||||
SpaceElement::refresh(&self.0);
|
||||
self.0.with_program(|p| {
|
||||
let mut windows = p.windows.lock().unwrap();
|
||||
|
||||
|
|
@ -1245,6 +1242,7 @@ impl SpaceElement for CosmicStack {
|
|||
SpaceElement::refresh(w)
|
||||
});
|
||||
});
|
||||
SpaceElement::refresh(&self.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue