Fix populated_tags to handle view on multiple tags
This commit is contained in:
parent
dee8fe9ab9
commit
39d6268487
20
src/main.rs
20
src/main.rs
@ -208,18 +208,16 @@ fn handle_river_output_status(
|
|||||||
tags,
|
tags,
|
||||||
} => {
|
} => {
|
||||||
if let Some(output) = env.outputs.get_mut(&output_id) {
|
if let Some(output) = env.outputs.get_mut(&output_id) {
|
||||||
output.populated_tags = tags[0..]
|
output.populated_tags.clear();
|
||||||
.chunks(4)
|
for tag_ind in 0..(tags.len()) {
|
||||||
.map(|s| {
|
for bit_ind in 0..=7 {
|
||||||
let buf = [s[0], s[1], s[2], s[3]];
|
if tags[tag_ind] & (1 << bit_ind) != 0 {
|
||||||
let tagmask = u32::from_le_bytes(buf);
|
output.populated_tags.push(
|
||||||
for i in 0..32 {
|
((tag_ind * 8 + bit_ind + 1) % 32) as u32
|
||||||
if 1 << i == tagmask {
|
);
|
||||||
return 1 + i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
0
|
}
|
||||||
}).collect();
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
zriver_output_status_v1::Event::UrgentTags {
|
zriver_output_status_v1::Event::UrgentTags {
|
||||||
|
Loading…
Reference in New Issue
Block a user