Reuse input handler when reusing a view tree

This commit is contained in:
Antonio Scandurra 2024-01-11 13:22:59 +01:00
parent d088ace404
commit 50ccdf5c16
4 changed files with 67 additions and 29 deletions

View file

@ -770,8 +770,8 @@ impl PlatformWindow for MacWindow {
self.0.as_ref().lock().input_handler = Some(input_handler);
}
fn clear_input_handler(&mut self) {
self.0.as_ref().lock().input_handler = None;
fn take_input_handler(&mut self) -> Option<Box<dyn PlatformInputHandler>> {
self.0.as_ref().lock().input_handler.take()
}
fn prompt(&self, level: PromptLevel, msg: &str, answers: &[&str]) -> oneshot::Receiver<usize> {