workspace: Implement focus-follows-mouse for panes#46740
workspace: Implement focus-follows-mouse for panes#46740ConradIrwin merged 7 commits intozed-industries:mainfrom
Conversation
afee1f6 to
4c14911
Compare
256bca9 to
4acefae
Compare
|
@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. |
|
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. |
|
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, |
|
I pushed up some tidy-up (to fix docks, and to prefer a cx global over a static), but this looks good to me. |
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 Really like this feature, thank you. Edit: It seems to work when an item in the tree is selected before hovering the Panel. |
|
@gianpaj I see it in your screenshot "Focus Follows Mouse" fourth from the top on the right :D |
|
@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.
BTW the Focus-follows-mouse doesn't work with the Agent panel |
) 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>



Implements basic focus-follows-mouse behavior.
Right now, it's only applied in the
workspacecrate forPanes, 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: