improv(minimize): simplify wayland subscription

Removes the redundant unbounded channel and forwards the subscription's
sender directly to the wayland handler.
This commit is contained in:
Michael Aaron Murphy 2025-01-21 09:55:55 +01:00
parent 2c79ca44e2
commit 0ce07ffac3
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
3 changed files with 46 additions and 97 deletions

View file

@ -147,7 +147,10 @@ impl cosmic::Application for Minimize {
self.apps.push((handle, info, data, None));
}
}
ToplevelUpdate::Remove(handle) => self.apps.retain(|a| a.0 != handle),
ToplevelUpdate::Remove(handle) => {
self.apps.retain(|a| a.0 != handle);
self.apps.shrink_to_fit();
}
},
WaylandUpdate::Image(handle, img) => {
if let Some(pos) = self.apps.iter().position(|a| a.0 == handle) {