From b154262dcbf0d1a5686921f24eb0b0c41ed95f29 Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Thu, 25 Aug 2022 09:18:56 +0300 Subject: feat: add hide_inactive_tags option --- src/river_protocols/status.rs | 8 ++++++++ src/river_protocols/status/dispatch.rs | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/river_protocols') diff --git a/src/river_protocols/status.rs b/src/river_protocols/status.rs index 50c85e0..f19ac5f 100644 --- a/src/river_protocols/status.rs +++ b/src/river_protocols/status.rs @@ -96,6 +96,14 @@ pub trait RiverStatusHandler: Sized { output_status: &RiverOutputStatus, urgent: u32, ); + + fn views_tags_updated( + &mut self, + conn: &Connection, + qh: &QueueHandle, + output_status: &RiverOutputStatus, + tags: Vec, + ); } #[derive(Debug, Clone)] diff --git a/src/river_protocols/status/dispatch.rs b/src/river_protocols/status/dispatch.rs index d38037d..65d6e0c 100644 --- a/src/river_protocols/status/dispatch.rs +++ b/src/river_protocols/status/dispatch.rs @@ -79,7 +79,13 @@ where match event { Event::FocusedTags { tags } => data.focused_tags_updated(conn, qh, &status, tags), Event::UrgentTags { tags } => data.urgent_tags_updated(conn, qh, &status, tags), - Event::ViewTags { tags: _ } => (), + Event::ViewTags { tags } => { + let tags = tags + .chunks_exact(4) + .map(|bytes| u32::from_ne_bytes(bytes.try_into().unwrap())) + .collect(); + data.views_tags_updated(conn, qh, &status, tags); + } } } } -- cgit v1.3.1