tree: fix jay hanging during shutdown
This commit is contained in:
parent
7476e6f2d9
commit
10090c0596
2 changed files with 12 additions and 13 deletions
|
|
@ -20,7 +20,6 @@ use {
|
||||||
xdg_wm_base::XdgWmBase,
|
xdg_wm_base::XdgWmBase,
|
||||||
},
|
},
|
||||||
object::{Object, ObjectId},
|
object::{Object, ObjectId},
|
||||||
tree::ToplevelNode,
|
|
||||||
utils::{
|
utils::{
|
||||||
clonecell::CloneCell,
|
clonecell::CloneCell,
|
||||||
copyhashmap::{CopyHashMap, Locked},
|
copyhashmap::{CopyHashMap, Locked},
|
||||||
|
|
@ -31,7 +30,7 @@ use {
|
||||||
ZwpPrimarySelectionSourceV1Id,
|
ZwpPrimarySelectionSourceV1Id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
std::{cell::RefCell, mem, ops::DerefMut, rc::Rc},
|
std::{cell::RefCell, mem, rc::Rc},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct Objects {
|
pub struct Objects {
|
||||||
|
|
@ -80,25 +79,21 @@ impl Objects {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn destroy(&self) {
|
pub fn destroy(&self) {
|
||||||
{
|
for surface in self.surfaces.lock().values() {
|
||||||
let mut toplevel = self.xdg_toplevel.lock();
|
if let Some(tl) = surface.get_toplevel() {
|
||||||
for obj in toplevel.values_mut() {
|
tl.tl_destroy();
|
||||||
obj.tl_destroy();
|
|
||||||
}
|
}
|
||||||
mem::take(toplevel.deref_mut());
|
|
||||||
}
|
}
|
||||||
{
|
for obj in self.registry.lock().values_mut() {
|
||||||
let mut registry = self.registry.lock();
|
obj.break_loops();
|
||||||
for obj in registry.values_mut() {
|
|
||||||
obj.break_loops();
|
|
||||||
}
|
|
||||||
mem::take(registry.deref_mut());
|
|
||||||
}
|
}
|
||||||
self.display.set(None);
|
self.display.set(None);
|
||||||
|
self.registry.clear();
|
||||||
self.registries.clear();
|
self.registries.clear();
|
||||||
self.outputs.clear();
|
self.outputs.clear();
|
||||||
self.surfaces.clear();
|
self.surfaces.clear();
|
||||||
self.xdg_surfaces.clear();
|
self.xdg_surfaces.clear();
|
||||||
|
self.xdg_toplevel.clear();
|
||||||
self.wl_data_source.clear();
|
self.wl_data_source.clear();
|
||||||
self.zwp_primary_selection_source.clear();
|
self.zwp_primary_selection_source.clear();
|
||||||
self.xdg_positioners.clear();
|
self.xdg_positioners.clear();
|
||||||
|
|
|
||||||
|
|
@ -231,6 +231,10 @@ impl WlSurface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_toplevel(&self) -> Option<Rc<dyn ToplevelNode>> {
|
||||||
|
self.toplevel.get()
|
||||||
|
}
|
||||||
|
|
||||||
fn set_absolute_position(&self, x1: i32, y1: i32) {
|
fn set_absolute_position(&self, x1: i32, y1: i32) {
|
||||||
self.buffer_abs_pos
|
self.buffer_abs_pos
|
||||||
.set(self.buffer_abs_pos.get().at_point(x1, y1));
|
.set(self.buffer_abs_pos.get().at_point(x1, y1));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue