Skip to content

Commit 136eac1

Browse files
authored
Merge pull request #14 from lincheney/support-floating_nodes-in-tree-reply
support floating_nodes in TREE reply
2 parents 0324b9c + 4388e48 commit 136eac1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/common.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ pub fn build_tree(val: &json::Value) -> reply::Node {
1414
.collect::<Vec<_>>(),
1515
None => vec![]
1616
},
17+
floating_nodes: match val.find("floating_nodes") {
18+
Some(nds) => nds.as_array()
19+
.unwrap()
20+
.iter()
21+
.map(|n| build_tree(n))
22+
.collect::<Vec<_>>(),
23+
None => vec![]
24+
},
1725
id: val.find("id").unwrap().as_i64().unwrap(),
1826
name: match val.find("name") {
1927
Some(n) => match n.as_string() {

src/reply.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ pub struct Node {
119119
/// The child nodes of this container.
120120
pub nodes: Vec<Node>,
121121

122+
/// The child floating nodes of this container.
123+
pub floating_nodes: Vec<Node>,
124+
122125
/// The internal ID (actually a C pointer value) of this container. Do not make any
123126
/// assumptions about it. You can use it to (re-)identify and address containers when
124127
/// talking to i3.

0 commit comments

Comments
 (0)