Skip to content

Commit

Permalink
fix cycle_layout bug when state.focus_w == root
Browse files Browse the repository at this point in the history
  • Loading branch information
AdaShoelace committed Aug 3, 2020
1 parent 43c01f8 commit f8402b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hdl_reactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl HdlReactor {
}

pub fn unset_focus(&self, w: Window, ww: &WindowWrapper) {
self.lib.ungrab_all_buttons(w);
// self.lib.ungrab_all_buttons(w);
self.lib.sync(false);
self.lib.set_border_color(w, CONFIG.background_color);
self.lib.resize_window(w, ww.get_size());
Expand Down
4 changes: 2 additions & 2 deletions src/wm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ pub fn reorder(state: &mut State) -> Option<()> {
.cloned()
.collect::<Vec<WindowWrapper>>();

if state.focus_w == state.lib.get_root() {
if state.focus_w == state.lib.get_root() && !windows.is_empty() {
debug!("reorder focus is root");
return None;
state.focus_w = *mon.get_newest()?.0;
}

let rects = mon.reorder(state.focus_w, &windows);
Expand Down

0 comments on commit f8402b2

Please sign in to comment.