1
0
Fork 0
forked from wry/wry

tree: add Node::node_output

This commit is contained in:
Julian Orth 2025-04-26 21:49:09 +02:00
parent 0dcb33ae38
commit b83bf0657b
15 changed files with 65 additions and 7 deletions

View file

@ -1783,6 +1783,10 @@ impl Node for WlSurface {
self.buffer_abs_pos.get()
}
fn node_output(&self) -> Option<Rc<OutputNode>> {
Some(self.output.get())
}
fn node_active_changed(&self, active: bool) {
if let Some(tl) = self.toplevel.get() {
tl.tl_surface_active_changed(active);

View file

@ -10,7 +10,7 @@ use {
leaks::Tracker,
object::{Object, Version},
rect::Rect,
tree::{FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor},
tree::{FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor, OutputNode},
utils::numcell::NumCell,
wire::{ExtSessionLockSurfaceV1Id, WlSurfaceId, ext_session_lock_surface_v1::*},
},
@ -123,6 +123,10 @@ impl Node for ExtSessionLockSurfaceV1 {
self.surface.node_absolute_position()
}
fn node_output(&self) -> Option<Rc<OutputNode>> {
self.output.node()
}
fn node_find_tree_at(
&self,
x: i32,

View file

@ -292,6 +292,10 @@ impl<T: TrayItem> Node for T {
self.data().surface.node_absolute_position()
}
fn node_output(&self) -> Option<Rc<OutputNode>> {
self.data().output.node()
}
fn node_find_tree_at(
&self,
x: i32,

View file

@ -12,7 +12,7 @@ use {
state::State,
tree::{
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
NodeVisitor, StackedNode, TileDragDestination, ToplevelData, ToplevelNode,
NodeVisitor, OutputNode, StackedNode, TileDragDestination, ToplevelData, ToplevelNode,
ToplevelNodeBase, WorkspaceNode, default_tile_drag_destination,
},
utils::{clonecell::CloneCell, copyhashmap::CopyHashMap, linkedlist::LinkedNode},
@ -346,6 +346,10 @@ impl Node for Xwindow {
self.data.info.extents.get()
}
fn node_output(&self) -> Option<Rc<OutputNode>> {
self.toplevel_data.output_opt()
}
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
seat.focus_toplevel(self.clone());
}

View file

@ -314,6 +314,10 @@ impl Node for XdgPopup {
self.xdg.absolute_desired_extents.get()
}
fn node_output(&self) -> Option<Rc<OutputNode>> {
self.xdg.workspace.get().map(|w| w.output.get())
}
fn node_find_tree_at(
&self,
x: i32,

View file

@ -523,6 +523,10 @@ impl Node for XdgToplevel {
self.xdg.absolute_desired_extents.get()
}
fn node_output(&self) -> Option<Rc<OutputNode>> {
self.toplevel_data.output_opt()
}
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
seat.focus_toplevel(self.clone());
}

View file

@ -648,6 +648,10 @@ impl Node for ZwlrLayerSurfaceV1 {
self.pos.get()
}
fn node_output(&self) -> Option<Rc<OutputNode>> {
self.output.node()
}
fn node_find_tree_at(
&self,
x: i32,