1
0
Fork 0
forked from wry/wry

tree: implement workspace dragging

This commit is contained in:
Julian Orth 2024-10-01 10:29:10 +02:00
parent 132986df2a
commit 1dd20fb87b
8 changed files with 235 additions and 7 deletions

View file

@ -9,7 +9,8 @@ use {
state::State,
tree::{
walker::NodeVisitor, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
OutputNode, StackedNode, TileDragDestination,
OutputNode, StackedNode, TileDragDestination, WorkspaceDragDestination,
WorkspaceNodeId,
},
utils::{copyhashmap::CopyHashMap, linkedlist::LinkedList},
},
@ -98,6 +99,21 @@ impl DisplayNode {
}
None
}
pub fn workspace_drag_destination(
&self,
source: WorkspaceNodeId,
x: i32,
y: i32,
) -> Option<WorkspaceDragDestination> {
for output in self.outputs.lock().values() {
let pos = output.node_absolute_position();
if pos.contains(x, y) {
return output.workspace_drag_destination(source, x, y);
}
}
None
}
}
impl Node for DisplayNode {