1
0
Fork 0
forked from wry/wry

it: simplify tracking of deleted objects

This commit is contained in:
Julian Orth 2022-05-03 17:31:44 +02:00
parent ae34a65efe
commit fd027d9a5a
17 changed files with 57 additions and 154 deletions

View file

@ -2,9 +2,7 @@ use {
crate::{
ifs::wl_surface::xdg_surface::xdg_toplevel::XdgToplevel,
it::{
test_error::TestError,
test_object::{Deleted, TestObject},
test_transport::TestTransport,
test_error::TestError, test_object::TestObject, test_transport::TestTransport,
testrun::ParseFull,
},
utils::buffd::MsgParser,
@ -22,7 +20,6 @@ pub struct TestXdgToplevel {
pub tran: Rc<TestTransport>,
pub destroyed: Cell<bool>,
pub server: Rc<XdgToplevel>,
pub deleted: Deleted,
pub width: Cell<i32>,
pub height: Cell<i32>,
@ -34,8 +31,7 @@ pub struct TestXdgToplevel {
impl TestXdgToplevel {
pub fn destroy(&self) -> Result<(), TestError> {
if !self.destroyed.replace(true) {
self.deleted.check()?;
self.tran.send(Destroy { self_id: self.id });
self.tran.send(Destroy { self_id: self.id })?;
}
Ok(())
}