fixed master / aux stack movement
This commit is contained in:
parent
80fdb915ab
commit
518c254c93
23
src/wm.rs
23
src/wm.rs
|
@ -366,7 +366,18 @@ impl WMState {
|
||||||
.next()
|
.next()
|
||||||
.and_then(|(_, c)| Some(c.clone())))
|
.and_then(|(_, c)| Some(c.clone())))
|
||||||
.and_then(|c| {
|
.and_then(|c| {
|
||||||
|
let weak_c = Rc::downgrade(&c);
|
||||||
|
if mstate
|
||||||
|
.master_stack
|
||||||
|
.iter()
|
||||||
|
.filter(|w| w.ptr_eq(&weak_c))
|
||||||
|
.count() == 0
|
||||||
|
{
|
||||||
mstate.master_stack.push(Rc::downgrade(&c));
|
mstate.master_stack.push(Rc::downgrade(&c));
|
||||||
|
} else {
|
||||||
|
mstate.master_stack.retain(|w| !w.ptr_eq(&weak_c));
|
||||||
|
}
|
||||||
|
|
||||||
Some(())
|
Some(())
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -746,17 +757,7 @@ impl WMState {
|
||||||
}
|
}
|
||||||
|
|
||||||
let window_w = {
|
let window_w = {
|
||||||
let has_aux_stack = state
|
let has_aux_stack = state.clients.len() != state.master_stack.len();
|
||||||
.clients
|
|
||||||
.iter()
|
|
||||||
.filter(|&(_, client)| {
|
|
||||||
state
|
|
||||||
.master_stack
|
|
||||||
.iter()
|
|
||||||
.filter(|weak_client| weak_client.upgrade().unwrap() != *client)
|
|
||||||
.count() != 0
|
|
||||||
})
|
|
||||||
.count() != 0;
|
|
||||||
|
|
||||||
if has_aux_stack {
|
if has_aux_stack {
|
||||||
screen_w / 2
|
screen_w / 2
|
||||||
|
|
Loading…
Reference in a new issue