1
0
Fork 0
forked from wry/wry

tree: implement tile dragging

This commit is contained in:
Julian Orth 2024-09-30 18:31:19 +02:00
parent 83fd9f211e
commit 132986df2a
17 changed files with 925 additions and 52 deletions

View file

@ -11,8 +11,9 @@ use {
renderer::Renderer,
state::State,
tree::{
Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor,
StackedNode, ToplevelData, ToplevelNode, ToplevelNodeBase, WorkspaceNode,
default_tile_drag_destination, ContainerSplit, Direction, FindTreeResult,
FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor, StackedNode,
TileDragDestination, ToplevelData, ToplevelNode, ToplevelNodeBase, WorkspaceNode,
},
utils::{clonecell::CloneCell, copyhashmap::CopyHashMap, linkedlist::LinkedNode},
wire::WlSurfaceId,
@ -467,6 +468,17 @@ impl ToplevelNodeBase for Xwindow {
fn tl_admits_children(&self) -> bool {
false
}
fn tl_tile_drag_destination(
self: Rc<Self>,
source: NodeId,
split: Option<ContainerSplit>,
abs_bounds: Rect,
abs_x: i32,
abs_y: i32,
) -> Option<TileDragDestination> {
default_tile_drag_destination(self, source, split, abs_bounds, abs_x, abs_y)
}
}
impl StackedNode for Xwindow {

View file

@ -25,9 +25,9 @@ use {
renderer::Renderer,
state::State,
tree::{
Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor,
OutputNode, ToplevelData, ToplevelNode, ToplevelNodeBase, ToplevelNodeId,
WorkspaceNode,
default_tile_drag_destination, ContainerSplit, Direction, FindTreeResult,
FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor, OutputNode, TileDragDestination,
ToplevelData, ToplevelNode, ToplevelNodeBase, ToplevelNodeId, WorkspaceNode,
},
utils::{clonecell::CloneCell, hash_map_ext::HashMapExt},
wire::{xdg_toplevel::*, XdgToplevelId},
@ -667,6 +667,17 @@ impl ToplevelNodeBase for XdgToplevel {
fn tl_admits_children(&self) -> bool {
false
}
fn tl_tile_drag_destination(
self: Rc<Self>,
source: NodeId,
split: Option<ContainerSplit>,
abs_bounds: Rect,
x: i32,
y: i32,
) -> Option<TileDragDestination> {
default_tile_drag_destination(self, source, split, abs_bounds, x, y)
}
}
impl XdgSurfaceExt for XdgToplevel {