fix: suspend hover focus during tab rename#97
Conversation
|
Thanks for chasing the hover-focus side of tab rename. I pushed a combined fix to main in The final implementation also adds the missing canonical lifecycle pieces from #109: only one active rename editor per pane, repeated rename refocuses/reuses instead of stacking, and tab activation/drag are suppressed while editing. Validation: |
bvolpato
left a comment
There was a problem hiding this comment.
Core approach looks good: RAII hover suppression and deferred blur cleanup address GTK focus timing cleanly.
nonblocking: this PR is superseded by f679daf on main. Current implementation includes these fixes plus single-editor lifecycle and tab interaction guards. This head is 26 commits behind and conflicts in both changed files, so it should close without merge.
(Review assisted by gpt-5.6-sol)
Hi. First off, nice project. I like it and I use this everyday now.
I noticed that when "Hover terminal focus" toggle is enabled I could not rename tabs without accidentally focusing on terminal. So I couldn't type inside the tab rename text field (which is bug 1), nor could I focus back at it (which is bug 2). This change attempts to fix both.
Bug 1
The way I implemented is to try a skip the hover focus code path by checking if any tab (
one or more .. so had to use a counter¹) is in "rename" state. I don't know if this was the cleanest fix, and I know zero rust (did c++ before but not rust), and codex did helped me through.¹ after my fix of bug 2 it can only be 1 tab in rename state at a time .. so this was a bit too defensive .. but changing it from counter to boolean doesn't reduce LoC either, so 🤷♂️ going to keep it the way it is
Bug 2
On checking code for this bug, I realized the code was meant to exit rename state on focus exit. But it remained in a partial exited state as you can see in this video:
https://github.com/user-attachments/assets/80348bf2-113c-4b76-ac53-8a21c512ef89
My understanding is that one cant just mutate tab state within
connect_leaveevent as GTK focus transitioning hasn't fully finished yet, and that's why this bug happens. You have to wait a bit. So my idea is 1. dont even rely on that event, rather watch forhas-focusbecoming false as that feels more stable state and 2. then add a GTK idle state callback to exit from the "rename" state.