Skip to content
This repository has been archived by the owner on Jan 11, 2020. It is now read-only.

Commit

Permalink
Fixed logic error in add_view, improved debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Timidger committed Jan 8, 2017
1 parent 72e9db6 commit e00c92d
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/layout/core/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,16 @@ impl LayoutTree {
}
return Ok(())
}
if let Some(node_ix) = self.active_container {
let id = self.tree[node_ix].get_id();
if let Some(fullscreen_id) = try!(self.in_fullscreen_workspace(id)) {
if fullscreen_id != id {
return Err(TreeError::Focus(FocusError::BlockedByFullscreen(id, fullscreen_id)))
}
let id = self.tree[node_ix].get_id();
if let Some(fullscreen_id) = try!(self.in_fullscreen_workspace(id)) {
if fullscreen_id != id {
return Err(TreeError::Focus(FocusError::BlockedByFullscreen(id, fullscreen_id)))
}
}
if self.active_container != Some(node_ix) {
info!("Active container was {}, is now {}",
self.active_container.map(|node| node.index().to_string())
.unwrap_or("not set".into()),
node_ix.index());
}
info!("Active container was {}, is now {}",
self.active_container.map(|node| node.index().to_string())
.unwrap_or("not set".into()),
node_ix.index());
self.active_container = Some(node_ix);
let c_type; let id;
{
Expand Down Expand Up @@ -284,8 +280,8 @@ impl LayoutTree {
self.tree.set_child_pos(view_ix, prev_pos);
self.validate();
match self.set_active_node(view_ix) {
// Ok, because fullscreen blocks focus grabbing
Ok(_) | Err(TreeError::Focus(FocusError::BlockedByFullscreen(_, _))) => {
Ok(_) => {},
Err(TreeError::Focus(FocusError::BlockedByFullscreen(_, _))) => {
debug!("Blocked focus by fullscreen");
},
Err(err) => return Err(err)
Expand Down Expand Up @@ -326,8 +322,8 @@ impl LayoutTree {
self.tree.move_node(child_ix, new_container_ix);
self.tree.set_child_pos(new_container_ix, *old_weight);
match self.set_active_node(new_container_ix) {
// Ok, because fullscreen blocks focus grabbing
Ok(_) | Err(TreeError::Focus(FocusError::BlockedByFullscreen(_, _))) => {
Ok(_) => {}
Err(TreeError::Focus(FocusError::BlockedByFullscreen(_, _))) => {
debug!("Blocked focus by fullscreen");
},
Err(err) => return Err(err)
Expand Down

0 comments on commit e00c92d

Please sign in to comment.