Skip to content

workspace: Implement focus-follows-mouse for panes#46740

Merged
ConradIrwin merged 7 commits intozed-industries:mainfrom
jrobsonchase:ffm
Apr 3, 2026
Merged

workspace: Implement focus-follows-mouse for panes#46740
ConradIrwin merged 7 commits intozed-industries:mainfrom
jrobsonchase:ffm

Conversation

@jrobsonchase
Copy link
Copy Markdown
Contributor

@jrobsonchase jrobsonchase commented Jan 13, 2026

Implements basic focus-follows-mouse behavior.

Right now, it's only applied in the workspace crate for Panes, so anything that lives outside of that container (panels and such for the most part) won't have this behavior applied. The core logic is implemented as an extension trait, and should be trivial to apply to other elements as it makes sense.

2026-01-16.10-15-08.mp4

Closes #8167

Release Notes:

  • Added "Focus Follows Mouse" for editor and terminal panes
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jan 13, 2026
@jrobsonchase jrobsonchase force-pushed the ffm branch 3 times, most recently from afee1f6 to 4c14911 Compare January 13, 2026 21:41
@jrobsonchase jrobsonchase marked this pull request as ready for review January 16, 2026 15:18
@maxdeviant maxdeviant changed the title workspace: implement focus-follows-mouse for panes Jan 16, 2026
@jrobsonchase jrobsonchase force-pushed the ffm branch 2 times, most recently from 256bca9 to 4acefae Compare January 30, 2026 14:17
@jrobsonchase jrobsonchase requested review from a team as code owners February 18, 2026 15:28
@ConradIrwin
Copy link
Copy Markdown
Member

@jrobsonchase thanks for this; the implementation seems reasonable to me, though I think (with no evidence) it's probably easier on compile times to put something this trivial into the workspace crate instead of adding a new one.

To feel complete, I think this also needs to work for panels. I also suspect (but have not tested) that when modals are open, the feature should be disabled.

@jrobsonchase
Copy link
Copy Markdown
Contributor Author

Panels meaning things like the file tree? Definitely agree there - I hate having to click into it before being able to create a new file or directory.

Can't speak to modals - don't recall ever having an issue with them, but something else that this definitely needs is some sort of debouncing for situations like trying to move the mouse from the right buffer to the file tree and transiting the left buffer in the process, causing the file tree to jump around and focus on the left buffer's file. Is there some prior art for debouncing somewhere in zed/gpui? If not, we can probably get away with something simple like a shared timer/variable.

@jrobsonchase
Copy link
Copy Markdown
Contributor Author

Alright, added a debounce timer and enabled ffm on all panels in the doc.

Regarding modals, I think it's already implicitly disabled. It seems nonfunctional when the file picker dialog, zed: about, and "restricted mode" modals are open at any rate.

@ConradIrwin
Copy link
Copy Markdown
Member

I pushed up some tidy-up (to fix docks, and to prefer a cx global over a static), but this looks good to me.

@ConradIrwin ConradIrwin enabled auto-merge (squash) April 3, 2026 19:31
@ConradIrwin ConradIrwin merged commit 203f48d into zed-industries:main Apr 3, 2026
30 checks passed
rtfeldman pushed a commit that referenced this pull request Apr 4, 2026
Implements basic focus-follows-mouse behavior.

Right now, it's only applied in the `workspace` crate for `Pane`s, so
anything that lives outside of that container (panels and such for the
most part) won't have this behavior applied. The core logic is
implemented as an extension trait, and should be trivial to apply to
other elements as it makes sense.



https://github.com/user-attachments/assets/d338fa30-7f9c-439f-8b50-1720e3f509b1



Closes #8167 

Release Notes:

- Added "Focus Follows Mouse" for editor and terminal panes

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
@jrobsonchase jrobsonchase deleted the ffm branch April 9, 2026 15:52
@tobiastom
Copy link
Copy Markdown

tobiastom commented Apr 16, 2026

@jrobsonchase Really like this feature, thank you.
Is it intentional that it does not seem to work with the Project Panel? The Outline Panel seems to work fine, but when I hover over the Project Panel, and try to use the cursor keys it does not seem to work.

Edit: It seems to work when an item in the tree is selected before hovering the Panel.

@gianpaj
Copy link
Copy Markdown

gianpaj commented Apr 22, 2026

Was this merged in Zed 0.232.3? I don't see this option or can enable it manually

image
image
@ConradIrwin
Copy link
Copy Markdown
Member

@gianpaj I see it in your screenshot "Focus Follows Mouse" fourth from the top on the right :D

@gianpaj
Copy link
Copy Markdown

gianpaj commented Apr 24, 2026

@ConradIrwin , you're right :D I'm getting old, and when searching it couldn't see the setting easily :P

I think all the Settings search results should appear on the right-hand side, so there is no need to know which submenu they're in.

image

BTW the Focus-follows-mouse doesn't work with the Agent panel

piper-of-dawn pushed a commit to piper-of-dawn/zed that referenced this pull request Apr 25, 2026
)

Implements basic focus-follows-mouse behavior.

Right now, it's only applied in the `workspace` crate for `Pane`s, so
anything that lives outside of that container (panels and such for the
most part) won't have this behavior applied. The core logic is
implemented as an extension trait, and should be trivial to apply to
other elements as it makes sense.



https://github.com/user-attachments/assets/d338fa30-7f9c-439f-8b50-1720e3f509b1



Closes zed-industries#8167 

Release Notes:

- Added "Focus Follows Mouse" for editor and terminal panes

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

5 participants