mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-22 09:29:24 +01:00
fix(stackbar): destroy stackbars on ws change
This commit ensures that whenever we receive a stackbar_manager::Notification any stackbars not associated with the current workspace on each monitor are destroyed. fix #838
This commit is contained in:
@@ -136,6 +136,27 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
|||||||
continue 'receiver;
|
continue 'receiver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Destroy any stackbars not associated with the focused workspace
|
||||||
|
let container_ids = ws
|
||||||
|
.containers()
|
||||||
|
.iter()
|
||||||
|
.map(|c| c.id().clone())
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
let mut to_remove = vec![];
|
||||||
|
for (id, stackbar) in stackbars.iter() {
|
||||||
|
if stackbars_monitors.get(id).copied().unwrap_or_default() == monitor_idx
|
||||||
|
&& !container_ids.contains(id)
|
||||||
|
{
|
||||||
|
stackbar.destroy()?;
|
||||||
|
to_remove.push(id.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for id in &to_remove {
|
||||||
|
stackbars.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
let container_padding = ws
|
let container_padding = ws
|
||||||
.container_padding()
|
.container_padding()
|
||||||
.unwrap_or_else(|| DEFAULT_CONTAINER_PADDING.load_consume());
|
.unwrap_or_else(|| DEFAULT_CONTAINER_PADDING.load_consume());
|
||||||
|
|||||||
Reference in New Issue
Block a user