portal: send toplevel identifier in jay_toplevel
This commit is contained in:
parent
8d6aaf79a7
commit
d4c0fb29ba
7 changed files with 92 additions and 15 deletions
|
|
@ -10,12 +10,15 @@ use {
|
|||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub const ID_SINCE: Version = Version(12);
|
||||
|
||||
pub struct JayToplevel {
|
||||
pub id: JayToplevelId,
|
||||
pub client: Rc<Client>,
|
||||
pub tracker: Tracker<Self>,
|
||||
pub toplevel: Rc<dyn ToplevelNode>,
|
||||
pub destroyed: Cell<bool>,
|
||||
pub version: Version,
|
||||
}
|
||||
|
||||
impl JayToplevel {
|
||||
|
|
@ -35,6 +38,18 @@ impl JayToplevel {
|
|||
fn send_destroyed(&self) {
|
||||
self.client.event(Destroyed { self_id: self.id });
|
||||
}
|
||||
|
||||
pub fn send_id(&self) {
|
||||
let s = self.toplevel.tl_data().identifier.get().to_string();
|
||||
self.client.event(Id {
|
||||
self_id: self.id,
|
||||
id: &s,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn send_done(&self) {
|
||||
self.client.event(Done { self_id: self.id })
|
||||
}
|
||||
}
|
||||
|
||||
impl JayToplevelRequestHandler for JayToplevel {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue