project_panel: Do not ignore first focus clicks on items (#58562)

When handling click events on entries in project panel, we were
returning early if the click was the one that brought the Zed window
into focus. This effectively ignored the click action on the item. This
leads to two clicks being required to act on an item in the project
panel if the Zed window is out of focus. The existing behaviour is also
inconsistent with other UI controls, where clicking on them when the
window is out of focus actually acts upon them.

This behaviour was introduced in
https://github.com/zed-industries/zed/pull/9553.

This PR fixes the click handler on the entries so that events with
`first_focus() == true` are no longer ignored.

Before:


https://github.com/user-attachments/assets/d51ec11d-c47a-4ea3-af6d-63bf6daf3c44

After:


https://github.com/user-attachments/assets/87b9e6a8-9ef0-463f-8557-e15d25b519ca

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #58261 

Release Notes:

- Fixed project panel needing a second click to change the file if the
window is not in focus
0cab9eeabaChintan committed on 6/5/2026, 9:03:35 AM· committed by GitHubparentb93d14e
1 file changedLine totals unavailable