Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store focus handles in AppContext instead of Window #22158

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

nathansobo
Copy link
Contributor

@nathansobo nathansobo commented Dec 17, 2024

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 moves the responsibility of storing focus handles from individual
windows to the app level. This will allow new focus handles to be created without
the need to reference the window, which paves the way for a simplification of
gpui's context types I'm working on.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 17, 2024
@nathansobo nathansobo merged commit 81c118d into main Dec 17, 2024
10 checks passed
@nathansobo nathansobo deleted the store-focus-handles-in-app branch December 17, 2024 21:41
helgemahrt pushed a commit to helgemahrt/zed that referenced this pull request Dec 18, 2024
…2158)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant