Transfer focus to the workspace when window focus is lost

This commit is contained in:
Antonio Scandurra 2023-12-07 15:35:30 +01:00 committed by Kirill Bulatov
parent 137104e00e
commit 43b8d65fee
3 changed files with 28 additions and 2 deletions

View file

@ -532,6 +532,11 @@ impl Workspace {
cx.notify()
})
.detach();
cx.on_window_focus_lost(|this, cx| {
let focus_handle = this.focus_handle(cx);
cx.focus(&focus_handle);
})
.detach();
let weak_handle = cx.view().downgrade();
let pane_history_timestamp = Arc::new(AtomicUsize::new(0));