Introduce a WindowContext::focus method that implies the window id

This commit is contained in:
Antonio Scandurra 2023-07-05 09:39:04 +02:00
parent 31483db5d8
commit 25564ea058
3 changed files with 8 additions and 8 deletions

View file

@ -244,8 +244,7 @@ impl ContextMenu {
let show_count = self.show_count;
cx.defer(move |this, cx| {
if cx.handle().is_focused(cx) && this.show_count == show_count {
let window_id = cx.window_id();
(**cx).focus(window_id, this.previously_focused_view_id.take());
(**cx).focus(this.previously_focused_view_id.take());
}
});
} else {