autocommit 2022-05-01 21:44:09 CEST
This commit is contained in:
parent
cca3850800
commit
04580c4aeb
38 changed files with 815 additions and 124 deletions
|
|
@ -591,9 +591,28 @@ impl WlSeatGlobal {
|
|||
self.cursor.get()
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
pub fn clear(self: &Rc<Self>) {
|
||||
mem::take(self.pointer_stack.borrow_mut().deref_mut());
|
||||
mem::take(self.found_tree.borrow_mut().deref_mut());
|
||||
self.keyboard_node.set(self.state.root.clone());
|
||||
self.state
|
||||
.root
|
||||
.clone()
|
||||
.node_visit(&mut generic_node_visitor(|node| {
|
||||
node.node_seat_state().on_seat_remove(self);
|
||||
}));
|
||||
self.bindings.borrow_mut().clear();
|
||||
self.data_devices.borrow_mut().clear();
|
||||
self.primary_selection_devices.borrow_mut().clear();
|
||||
self.cursor.set(None);
|
||||
self.selection.set(None);
|
||||
self.primary_selection.set(None);
|
||||
self.pointer_owner.clear();
|
||||
self.kb_owner.clear();
|
||||
*self.dropped_dnd.borrow_mut() = None;
|
||||
self.queue_link.set(None);
|
||||
self.tree_changed_handler.set(None);
|
||||
self.output.set(self.state.dummy_output.get().unwrap());
|
||||
}
|
||||
|
||||
pub fn id(&self) -> SeatId {
|
||||
|
|
|
|||
|
|
@ -149,6 +149,13 @@ impl NodeSeatState {
|
|||
self.destroy_node2(node, false);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn on_seat_remove(&self, seat: &WlSeatGlobal) {
|
||||
self.kb_foci.remove(&seat.id);
|
||||
self.pointer_foci.remove(&seat.id);
|
||||
self.dnd_targets.remove(&seat.id);
|
||||
self.pointer_grabs.remove(&seat.id);
|
||||
}
|
||||
}
|
||||
|
||||
impl WlSeatGlobal {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ impl KbOwnerHolder {
|
|||
pub fn set_kb_node(&self, seat: &Rc<WlSeatGlobal>, node: Rc<dyn Node>) {
|
||||
self.owner.get().set_kb_node(seat, node);
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
self.owner.set(self.default.clone());
|
||||
}
|
||||
}
|
||||
|
||||
struct DefaultKbOwner;
|
||||
|
|
|
|||
|
|
@ -115,6 +115,10 @@ impl PointerOwnerHolder {
|
|||
pub fn remove_dnd_icon(&self) {
|
||||
self.owner.get().remove_dnd_icon()
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
self.owner.set(self.default.clone());
|
||||
}
|
||||
}
|
||||
|
||||
trait PointerOwner {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue