# workspace: Update window title when switching active workspace \(\#58401\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a32999e00b01a3b1ac2208589dfeb9debac0aa9b

Requested commit: a32999e00b01a3b1ac2208589dfeb9debac0aa9b

Commit: a32999e00b01a3b1ac2208589dfeb9debac0aa9b

Tree: 84484e3c267ab54d64165c4cf06115ecd00f5e0f

Author: Lukas Wirth

Committer: GitHub

## Message

```
workspace: Update window title when switching active workspace (#58401)

In a multi-workspace window several workspaces share one platform
window. Switching the active workspace did not update the window title
or edited indicator, and background workspaces could clobber the active
workspace's title via their still-live project/item event subscriptions.

Track the active workspace id in a shared Rc<Cell<EntityId>> owned by
the MultiWorkspace and read by each member workspace, so a workspace
only writes the shared window's title/edited state when it is the active
one. The newly active workspace re-applies its title and edited
indicator on activation. We use a Rc-cell here to avoid double lease
issues as we cannot tell whether we are inside a running MultiWorkspace
lease or not in the given codepaths.

Release Notes:

- Fixed the window title not updating when switching between workspaces
in a multi-workspace window

---------

Co-authored-by: Eric Holk <eric@theincredibleholk.org>
```

## Parents

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

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