1
0
Fork 0
forked from wry/wry

wl_usr: refactor interfaces

This commit is contained in:
Julian Orth 2026-02-22 00:14:19 +01:00
parent 4b3d3a50cd
commit 56290d5547
12 changed files with 121 additions and 82 deletions

View file

@ -37,16 +37,14 @@ impl UsrWlSurface {
});
}
pub fn frame<F>(&self, f: F)
where
F: FnOnce() + 'static,
{
let cb = Rc::new(UsrWlCallback::new(&self.con, f));
pub fn frame(&self) -> Rc<UsrWlCallback> {
let cb = Rc::new(UsrWlCallback::new(&self.con));
self.con.request(Frame {
self_id: self.id,
callback: cb.id,
});
self.con.add_object(cb);
self.con.add_object(cb.clone());
cb
}
pub fn commit(&self) {