tree: implement tile dragging
This commit is contained in:
parent
83fd9f211e
commit
132986df2a
17 changed files with 925 additions and 52 deletions
|
|
@ -64,6 +64,7 @@ pub struct NodeSeatState {
|
|||
dnd_targets: SmallMap<SeatId, Rc<WlSeatGlobal>, 1>,
|
||||
tablet_pad_foci: SmallMap<TabletPadId, Rc<TabletPad>, 1>,
|
||||
tablet_tool_foci: SmallMap<TabletToolId, Rc<TabletTool>, 1>,
|
||||
ui_drags: SmallMap<SeatId, Rc<WlSeatGlobal>, 1>,
|
||||
}
|
||||
|
||||
impl NodeSeatState {
|
||||
|
|
@ -101,6 +102,14 @@ impl NodeSeatState {
|
|||
self.pointer_grabs.remove(&seat.id);
|
||||
}
|
||||
|
||||
pub(super) fn add_ui_drag(&self, seat: &Rc<WlSeatGlobal>) {
|
||||
self.ui_drags.insert(seat.id, seat.clone());
|
||||
}
|
||||
|
||||
pub(super) fn remove_ui_drag(&self, seat: &WlSeatGlobal) {
|
||||
self.ui_drags.remove(&seat.id);
|
||||
}
|
||||
|
||||
pub(super) fn add_tablet_pad_focus(&self, pad: &Rc<TabletPad>) {
|
||||
self.tablet_pad_foci.insert(pad.id, pad.clone());
|
||||
}
|
||||
|
|
@ -176,6 +185,9 @@ impl NodeSeatState {
|
|||
while let Some((_, seat)) = self.pointer_grabs.pop() {
|
||||
seat.pointer_owner.grab_node_removed(&seat);
|
||||
}
|
||||
while let Some((_, seat)) = self.ui_drags.pop() {
|
||||
seat.pointer_owner.revert_to_default(&seat);
|
||||
}
|
||||
let node_id = node.node_id();
|
||||
while let Some((_, seat)) = self.dnd_targets.pop() {
|
||||
seat.pointer_owner.dnd_target_removed(&seat);
|
||||
|
|
@ -1100,8 +1112,11 @@ impl WlSeatGlobal {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn trigger_tree_changed(&self) {
|
||||
pub fn trigger_tree_changed(&self, needs_layout: bool) {
|
||||
// log::info!("trigger_tree_changed");
|
||||
if needs_layout {
|
||||
self.tree_changed_needs_layout.set(true);
|
||||
}
|
||||
self.tree_changed.trigger();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue