con_props -> extra_props

timeout_old
Tassilo Horn 3 years ago
parent 4ff03e7038
commit 8c396ff27d
  1. 17
      src/con.rs

@ -142,7 +142,8 @@ fn build_workspaces<'a>(
wins.sort(); wins.sort();
v.push(Workspace { v.push(Workspace {
node: &workspace, node: &workspace,
con_props: extra_props.and_then(|m| m.get(&workspace.id).cloned()), extra_props: extra_props
.and_then(|m| m.get(&workspace.id).cloned()),
windows: wins, windows: wins,
}) })
} }
@ -167,9 +168,9 @@ pub fn get_windows<'a>(
pub fn get_workspaces<'a>( pub fn get_workspaces<'a>(
root: &'a r::Node, root: &'a r::Node,
include_scratchpad: bool, include_scratchpad: bool,
con_props: Option<&HashMap<i64, ipc::ExtraProps>>, extra_props: Option<&HashMap<i64, ipc::ExtraProps>>,
) -> Vec<Workspace<'a>> { ) -> Vec<Workspace<'a>> {
let workspaces = build_workspaces(root, con_props); let workspaces = build_workspaces(root, extra_props);
let mut workspaces = if include_scratchpad { let mut workspaces = if include_scratchpad {
workspaces workspaces
} else { } else {
@ -237,7 +238,7 @@ pub fn select_workspace_or_window<'a>(
pub struct Workspace<'a> { pub struct Workspace<'a> {
node: &'a r::Node, node: &'a r::Node,
con_props: Option<ipc::ExtraProps>, extra_props: Option<ipc::ExtraProps>,
pub windows: Vec<Window<'a>>, pub windows: Vec<Window<'a>>,
} }
@ -269,9 +270,11 @@ impl Ord for Workspace<'_> {
cmp::Ordering::Equal cmp::Ordering::Equal
} else { } else {
let lru_a = let lru_a =
self.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 = let lru_b = other
other.con_props.as_ref().map_or(0, |wp| wp.last_focus_time); .extra_props
.as_ref()
.map_or(0, |wp| wp.last_focus_time);
lru_a.cmp(&lru_b).reverse() lru_a.cmp(&lru_b).reverse()
} }
} }

Loading…
Cancel
Save