Store focus handles in AppContext instead of Window (#22158)
Previously, each window stored its own collection of focus handles. This meant that to create a focus handle, you needed to have access to a Window. I'm working on a simplification to gpui's context types that removes `WindowContext` and `ViewContext` in favor of passing a window reference explicitly when rendering or handling events. You'll still need a window to manipulate focus, but it will be helpful to be able to create focus handles without a window. cc @mgsloan Release Notes: - N/A
This commit is contained in:
parent
e1ca5ed836
commit
81c118d67d
3 changed files with 43 additions and 40 deletions
|
@ -500,7 +500,7 @@ impl AnyElement {
|
|||
|
||||
if !focus_assigned {
|
||||
if let Some(focus_id) = cx.window.next_frame.focus {
|
||||
return FocusHandle::for_id(focus_id, &cx.window.focus_handles);
|
||||
return FocusHandle::for_id(focus_id, &cx.focus_handles);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue