tree: add Node::node_accepts_focus
This commit is contained in:
parent
dbc954dded
commit
5a004c3d31
4 changed files with 20 additions and 0 deletions
|
|
@ -382,6 +382,10 @@ impl Node for Xwindow {
|
||||||
self.toplevel_data.node_layer()
|
self.toplevel_data.node_layer()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_accepts_focus(&self) -> bool {
|
||||||
|
self.tl_accepts_keyboard_focus()
|
||||||
|
}
|
||||||
|
|
||||||
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
|
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
|
||||||
seat.focus_toplevel(self.clone());
|
seat.focus_toplevel(self.clone());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -679,6 +679,10 @@ impl Node for ZwlrLayerSurfaceV1 {
|
||||||
SurfaceExt::node_layer(self)
|
SurfaceExt::node_layer(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_accepts_focus(&self) -> bool {
|
||||||
|
self.keyboard_interactivity.get() != KI_NONE
|
||||||
|
}
|
||||||
|
|
||||||
fn node_find_tree_at(
|
fn node_find_tree_at(
|
||||||
&self,
|
&self,
|
||||||
x: i32,
|
x: i32,
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,11 @@ pub trait Node: 'static {
|
||||||
let _ = title;
|
let _ = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[expect(dead_code)]
|
||||||
|
fn node_accepts_focus(&self) -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, direction: Direction) {
|
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, direction: Direction) {
|
||||||
let _ = seat;
|
let _ = seat;
|
||||||
let _ = direction;
|
let _ = direction;
|
||||||
|
|
|
||||||
|
|
@ -720,6 +720,13 @@ impl Node for FloatNode {
|
||||||
self.update_child_title(title);
|
self.update_child_title(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_accepts_focus(&self) -> bool {
|
||||||
|
if let Some(c) = self.child.get() {
|
||||||
|
return c.tl_accepts_keyboard_focus();
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
fn node_find_tree_at(
|
fn node_find_tree_at(
|
||||||
&self,
|
&self,
|
||||||
x: i32,
|
x: i32,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue