1
0
Fork 0
forked from wry/wry

tree: never focus wl-subsurface surfaces

This commit is contained in:
Julian Orth 2022-05-05 14:04:15 +02:00
parent 5afde58086
commit 4584dee160
15 changed files with 150 additions and 35 deletions

View file

@ -163,8 +163,8 @@ trait SurfaceExt {
None
}
fn accepts_kb_focus(&self) -> bool {
true
fn focus_node(&self) -> Option<Rc<dyn Node>> {
None
}
}
@ -266,10 +266,11 @@ impl WlSurface {
Ok(cursor)
}
pub fn accepts_kb_focus(&self) -> bool {
pub fn get_focus_node(&self, seat: SeatId) -> Option<Rc<dyn Node>> {
match self.toplevel.get() {
Some(tl) => tl.tl_accepts_keyboard_focus(),
_ => self.ext.get().accepts_kb_focus(),
Some(tl) if tl.tl_accepts_keyboard_focus() => tl.tl_focus_child(seat),
Some(_) => None,
_ => self.ext.get().focus_node(),
}
}