# linux: Fix buttons clicks wouldn’t work on startup until clicked on center pane \(\#34590\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ebad5ca50e11fc9d3fbbab397888d0944a825bb7

Requested commit: ebad5ca50e11fc9d3fbbab397888d0944a825bb7

Commit: ebad5ca50e11fc9d3fbbab397888d0944a825bb7

Tree: 0bbfcbf26829d761fca5343866960aaa1ccb90d1

Author: Smit Barmase

Committer: GitHub

## Message

```
linux: Fix buttons clicks wouldn’t work on startup until clicked on center pane (#34590)

Closes #31805

This is an issue with Linux currently that `window.focus` is `None` upon
startup in both X11 and Wayland. Specifically, the order in which
[this](https://github.com/zed-industries/zed/blob/8d05a3d389b6a1caa80bb18f26c3dac0c26debcb/crates/gpui/src/window.rs#L3116)
and
[this](https://github.com/zed-industries/zed/blob/8d05a3d389b6a1caa80bb18f26c3dac0c26debcb/crates/gpui/src/app.rs#L956)
are executed varies between Linux and macOS. That is, one tries to
remove (blur) focus from a window, while other checks window focus to
put that focus id to a frame. In macOS, blur happens afterwards setting
focus on a frame, but in Linux, the inverse of it happens, leading to
`window.focus` to `None`.

For the time being, we handle all visible buttons to take care of this
**focus can be `None`** case, and make it work anyway. But, we should
look at the deeper issue mentioned above with GPUI. Created new issue to
track that https://github.com/zed-industries/zed/issues/34591.

Release Notes:

- Fixed an issue where button clicks wouldn’t work on startup until
clicked on the center pane on Linux.
```

## Parents

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

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