# linux/x11: Fix closing of GPUI windows not working \(\#13201\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 64d815a1766db69aabedc74069cef9b6c134f42f

Requested commit: 64d815a1766db69aabedc74069cef9b6c134f42f

Commit: 64d815a1766db69aabedc74069cef9b6c134f42f

Tree: 711a0a62c7462c4b4bf38522e35fadac6eec5916

Author: Thorsten Ball

Committer: GitHub

## Message

```
linux/x11: Fix closing of GPUI windows not working (#13201)

This fixes everything but the main Zed window (GPUI examples, prompt
library, etc.) not being closable by clicking on the X in X11.

We had a dangling reference before: we would remove the window from the
X11 state, but GPUI itself would still have the window in its
references.

In order to fix this we have to call `window.close()`, which ends up
calling `cx.remove_window()`, which removes the reference.

That in turn then causes the reference to be dropped, which cleans up
the X11 state for the window.

Release Notes:

- N/A
```

## Parents

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

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