Skip to content

fix: suspend hover focus during tab rename#97

Open
Munawwar wants to merge 2 commits into
am-will:mainfrom
Munawwar:fix/rename-hover-focus-guard
Open

fix: suspend hover focus during tab rename#97
Munawwar wants to merge 2 commits into
am-will:mainfrom
Munawwar:fix/rename-hover-focus-guard

Conversation

@Munawwar

@Munawwar Munawwar commented Jun 3, 2026

Copy link
Copy Markdown

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_leave event 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 for has-focus becoming false as that feels more stable state and 2. then add a GTK idle state callback to exit from the "rename" state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant