From 4ff03e7038536e36cd3bc4f131910869d4cd4d1d Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Wed, 17 Feb 2021 14:53:01 +0100 Subject: [PATCH] con_props -> extra_props --- src/con.rs | 14 ++++++++------ src/demon.rs | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/con.rs b/src/con.rs index 3ae3381..7275009 100644 --- a/src/con.rs +++ b/src/con.rs @@ -12,7 +12,7 @@ use swayipc::reply as r; pub struct Window<'a> { node: &'a r::Node, workspace: &'a r::Node, - con_props: Option, + extra_props: Option, } impl Window<'_> { @@ -70,9 +70,11 @@ impl Ord for Window<'_> { std::cmp::Ordering::Greater } else { let lru_a = - self.con_props.as_ref().map_or(0, |wp| wp.last_focus_time); - let lru_b = - other.con_props.as_ref().map_or(0, |wp| wp.last_focus_time); + self.extra_props.as_ref().map_or(0, |wp| wp.last_focus_time); + let lru_b = other + .extra_props + .as_ref() + .map_or(0, |wp| wp.last_focus_time); lru_a.cmp(&lru_b).reverse() } } @@ -114,7 +116,7 @@ fn build_windows<'a>( for n in workspace.windows() { v.push(Window { node: &n, - con_props: extra_props.and_then(|m| m.get(&n.id).cloned()), + extra_props: extra_props.and_then(|m| m.get(&n.id).cloned()), workspace: &workspace, }) } @@ -133,7 +135,7 @@ fn build_workspaces<'a>( .iter() .map(|w| Window { node: &w, - con_props: extra_props.and_then(|m| m.get(&w.id).cloned()), + extra_props: extra_props.and_then(|m| m.get(&w.id).cloned()), workspace: &workspace, }) .collect(); diff --git a/src/demon.rs b/src/demon.rs index 18549bb..5fc45bd 100644 --- a/src/demon.rs +++ b/src/demon.rs @@ -16,15 +16,15 @@ use swayipc as s; use swayipc::reply as r; pub fn run_demon() { - let con_props: Arc>> = + let extra_props: Arc>> = Arc::new(RwLock::new(HashMap::new())); - let con_props_for_ev_handler = con_props.clone(); + let extra_props_for_ev_handler = extra_props.clone(); thread::spawn(move || { - monitor_sway_events(con_props_for_ev_handler); + monitor_sway_events(extra_props_for_ev_handler); }); - serve_client_requests(con_props); + serve_client_requests(extra_props); } fn connect_and_subscribe() -> s::Fallible {