fix(wayland): properly destroy panel items
This commit is contained in:
@@ -92,7 +92,7 @@ pub struct Item {
|
||||
pub specialization: ItemType,
|
||||
}
|
||||
impl Item {
|
||||
pub fn new(
|
||||
pub fn add_to(
|
||||
node: &Arc<Node>,
|
||||
type_info: &'static TypeInfo,
|
||||
specialization: ItemType,
|
||||
@@ -109,6 +109,7 @@ impl Item {
|
||||
if let Some(ui) = type_info.ui.lock().upgrade() {
|
||||
ui.handle_create_item(&item);
|
||||
}
|
||||
let _ = node.item.set(item.clone());
|
||||
item
|
||||
}
|
||||
fn make_alias(&self, client: &Arc<Client>, parent: &str) -> (Arc<Node>, Arc<Alias>) {
|
||||
@@ -173,9 +174,11 @@ pub struct EnvironmentItem {
|
||||
}
|
||||
impl EnvironmentItem {
|
||||
pub fn add_to(node: &Arc<Node>, path: String) {
|
||||
let specialization = ItemType::Environment(EnvironmentItem { path });
|
||||
let item = Item::new(node, &ITEM_TYPE_INFO_ENVIRONMENT, specialization);
|
||||
let _ = node.item.set(item);
|
||||
Item::add_to(
|
||||
node,
|
||||
&ITEM_TYPE_INFO_ENVIRONMENT,
|
||||
ItemType::Environment(EnvironmentItem { path }),
|
||||
);
|
||||
node.add_local_method("getPath", EnvironmentItem::get_path_flex);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user