fix(pop-shell): Implement 'Quit' request handler
This commit is contained in:
parent
8eb3104920
commit
3b4136eeef
1 changed files with 8 additions and 1 deletions
|
|
@ -45,7 +45,7 @@ pub async fn main() {
|
|||
match request {
|
||||
Ok(request) => match request {
|
||||
Request::Activate(id) => app.activate(id).await,
|
||||
Request::Quit(_id) => (),
|
||||
Request::Quit(id) => app.quit(id).await,
|
||||
Request::Search(query) => app.search(&query).await,
|
||||
Request::Exit => break,
|
||||
_ => (),
|
||||
|
|
@ -98,6 +98,13 @@ impl<W: AsyncWrite + Unpin> App<W> {
|
|||
}
|
||||
}
|
||||
|
||||
async fn quit(&mut self, id: u32) {
|
||||
if let Some(id) = self.entries.get(id as usize) {
|
||||
let entity = id.entity;
|
||||
let _ = self.call_method("WindowQuit", &(entity,));
|
||||
}
|
||||
}
|
||||
|
||||
async fn search(&mut self, query: &str) {
|
||||
let query = query.to_ascii_lowercase();
|
||||
let haystack = query.split_ascii_whitespace().collect::<Vec<&str>>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue