tiling: Focus whole stack on Focus::In
This commit is contained in:
parent
5884e287a5
commit
1452281fa7
3 changed files with 18 additions and 1 deletions
|
|
@ -465,6 +465,13 @@ impl CosmicMapped {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn stack_ref(&self) -> Option<&CosmicStack> {
|
||||||
|
match &self.element {
|
||||||
|
CosmicMappedInternal::Stack(stack) => Some(stack),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn stack_ref_mut(&mut self) -> Option<&mut CosmicStack> {
|
pub fn stack_ref_mut(&mut self) -> Option<&mut CosmicStack> {
|
||||||
match &mut self.element {
|
match &mut self.element {
|
||||||
CosmicMappedInternal::Stack(stack) => Some(stack),
|
CosmicMappedInternal::Stack(stack) => Some(stack),
|
||||||
|
|
|
||||||
|
|
@ -436,6 +436,11 @@ impl CosmicStack {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(in super::super) fn focus_stack(&self) {
|
||||||
|
self.0
|
||||||
|
.with_program(|p| p.group_focused.store(true, Ordering::SeqCst));
|
||||||
|
}
|
||||||
|
|
||||||
pub(super) fn loop_handle(&self) -> LoopHandle<'static, crate::state::Data> {
|
pub(super) fn loop_handle(&self) -> LoopHandle<'static, crate::state::Data> {
|
||||||
self.0.loop_handle()
|
self.0.loop_handle()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -984,7 +984,12 @@ impl TilingLayout {
|
||||||
|
|
||||||
if let Some(id) = id {
|
if let Some(id) = id {
|
||||||
return match tree.get(&id).unwrap().data() {
|
return match tree.get(&id).unwrap().data() {
|
||||||
Data::Mapped { mapped, .. } => FocusResult::Some(mapped.clone().into()),
|
Data::Mapped { mapped, .. } => {
|
||||||
|
if mapped.is_stack() {
|
||||||
|
mapped.stack_ref().unwrap().focus_stack();
|
||||||
|
}
|
||||||
|
FocusResult::Some(mapped.clone().into())
|
||||||
|
}
|
||||||
Data::Group { alive, .. } => FocusResult::Some(
|
Data::Group { alive, .. } => FocusResult::Some(
|
||||||
WindowGroup {
|
WindowGroup {
|
||||||
node: id,
|
node: id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue