Ensure focus_in and focus_out fire on window activation (#3993)

Also:
- Rename cx.on_blur to cx.on_focus_lost
- Fix a bug where notify calls in focus handlers were ignored
- Fix a bug where vim would get stuck in the wrong mode when switching
  windows

Release Notes:

- (preview only) vim: fix switching between multiple windows
This commit is contained in:
Conrad Irwin 2024-01-10 10:00:07 -07:00 committed by GitHub
commit 5dff458014
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 26 deletions

View file

@ -186,6 +186,7 @@ impl TestAppContext {
drop(cx);
let view = window.root_view(self).unwrap();
let cx = Box::new(VisualTestContext::from_window(*window.deref(), self));
cx.run_until_parked();
// it might be nice to try and cleanup these at the end of each test.
(view, Box::leak(cx))
}