fix: ensure TagEmpty event fires
This commit is contained in:
parent
60a7f4ddff
commit
18d349c11f
@ -250,13 +250,12 @@ impl NiriTag {
|
||||
}
|
||||
};
|
||||
let rm_tag = async |tx: Sender<TagEvent>, windows: &HashMap<u64, u8>, wid, old_tag| {
|
||||
if old_tag != 0
|
||||
&& windows
|
||||
.iter()
|
||||
.filter(|(w, tag)| **tag == old_tag && **w != wid)
|
||||
.collect::<Vec<(_, _)>>()
|
||||
.is_empty()
|
||||
{
|
||||
tracing::debug!("removing tag {}", wid);
|
||||
let same_tagged = windows
|
||||
.iter()
|
||||
.filter(|(w, tag)| **tag == old_tag && **w != wid)
|
||||
.count();
|
||||
if same_tagged == 0 && old_tag != 0 {
|
||||
send_event(tx, TagEvent::TagEmpty(old_tag)).await;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user