# Rely on root getting re-focused when panel isn't rendered · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e507eadb4b08d284d04a906ddd80517193104ceb)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: e507eadb4b08d284d04a906ddd80517193104ceb

Requested commit: e507eadb4b08d284d04a906ddd80517193104ceb

Commit: e507eadb4b08d284d04a906ddd80517193104ceb

Tree: 573d0dfb4a9aeab77102550e0f110a56b7a565f5

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Rely on root getting re-focused when panel isn't rendered

This achieves two things:

- When a panel like `TerminalPanel` closes its last tab, the focus
is returned to the root view (the `Workspace`)
- When a panel is moved from a dock to another, it will get rendered
in another spot but the focus will be kept on the panel

This also ensures the focus is not lost when a panel is moved from
a dock to another because that view

```

## Parents

- [9b9d53fcf8247fea9fca3323c301dd5667a2bd20](https://git.cafe/gitcafe/zed/commit/9b9d53fcf8247fea9fca3323c301dd5667a2bd20?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/e507eadb4b08d284d04a906ddd80517193104ceb?format=markdown)
