From 3b4136eeef4c0124254820b4ca1439efe43a5323 Mon Sep 17 00:00:00 2001 From: Ningvin Date: Wed, 22 Dec 2021 22:05:01 +0100 Subject: [PATCH] fix(pop-shell): Implement 'Quit' request handler --- plugins/src/pop_shell/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/src/pop_shell/mod.rs b/plugins/src/pop_shell/mod.rs index 9f9a625..739d990 100644 --- a/plugins/src/pop_shell/mod.rs +++ b/plugins/src/pop_shell/mod.rs @@ -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 App { } } + 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::>();