1
0
Fork 0
forked from wry/wry

all: add HashMapExt

This commit is contained in:
Julian Orth 2024-05-08 15:13:21 +02:00
parent 4c0e6d9b51
commit 0d7a07ec40
29 changed files with 99 additions and 69 deletions

View file

@ -23,6 +23,7 @@ use {
clonecell::CloneCell,
double_click_state::DoubleClickState,
errorfmt::ErrorFmt,
hash_map_ext::HashMapExt,
linkedlist::{LinkedList, LinkedNode, NodeRef},
numcell::NumCell,
rc_eq::rc_eq,
@ -1613,7 +1614,7 @@ impl ToplevelNodeBase for ContainerNode {
fn tl_destroy_impl(&self) {
mem::take(self.cursors.borrow_mut().deref_mut());
let mut cn = self.child_nodes.borrow_mut();
for (_, n) in cn.drain() {
for n in cn.drain_values() {
n.node.tl_destroy();
}
}

View file

@ -36,7 +36,8 @@ use {
},
utils::{
clonecell::CloneCell, copyhashmap::CopyHashMap, errorfmt::ErrorFmt,
linkedlist::LinkedList, scroller::Scroller, transform_ext::TransformExt,
hash_map_ext::HashMapExt, linkedlist::LinkedList, scroller::Scroller,
transform_ext::TransformExt,
},
wire::{JayOutputId, JayScreencastId, ZwlrScreencopyFrameV1Id},
},
@ -140,7 +141,7 @@ impl OutputNode {
return;
}
let now = Time::now().unwrap();
for (_, capture) in self.screencopies.lock().drain() {
for capture in self.screencopies.lock().drain_values() {
let wl_buffer = match capture.buffer.take() {
Some(b) => b,
_ => {

View file

@ -15,6 +15,7 @@ use {
utils::{
clonecell::CloneCell,
copyhashmap::CopyHashMap,
hash_map_ext::HashMapExt,
numcell::NumCell,
smallmap::SmallMap,
threshold_counter::ThresholdCounter,
@ -289,16 +290,16 @@ impl ToplevelData {
}
pub fn destroy_node(&self, node: &dyn Node) {
for (_, jay_tl) in self.jay_toplevels.lock().drain() {
for jay_tl in self.jay_toplevels.lock().drain_values() {
jay_tl.destroy();
}
for (_, screencast) in self.jay_screencasts.lock().drain() {
for screencast in self.jay_screencasts.lock().drain_values() {
screencast.do_destroy();
}
self.identifier.set(toplevel_identifier());
{
let mut handles = self.handles.lock();
for (_, handle) in handles.drain() {
for handle in handles.drain_values() {
handle.send_closed();
}
}