Merge branch 'fix/tab-hover-timer-reset' of https://github.com/xiaobai050/kitty
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run

This commit is contained in:
Kovid Goyal 2026-09-26 16:45:31 +05:30
commit 8a5d98b7bb
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 13 additions and 1 deletions

View file

@ -2098,7 +2098,10 @@ class TabManager: # {{{
tab_id = target.tab_id if target is not None else 0
# Highlight the "+" button only when appending, elsewhere the insertion marker is enough
self._set_drag_target_tab(-1 if before == 0 else tab_id)
self._update_drag_hover(tab_id, window_id, source_is_window=True)
# Tab drags clear the window preview before updating the tab preview on
# every drag event. Keep an existing tab hover timer across those events.
if tab_id or self.drag_hover is None or self.drag_hover.source_is_window:
self._update_drag_hover(tab_id, window_id, source_is_window=True)
def _clear_force_show_title_bars(self) -> None:
boss = get_boss()

View file

@ -593,6 +593,15 @@ class TestWindowDropTabs(BaseTest):
self.hover()
self.ae(self.add_timer.call_count, 1)
def test_clearing_window_preview_preserves_tab_hover(self):
self.tm._update_drag_hover(2, 9, source_is_window=False)
hover = self.tm.drag_hover
for _ in range(3):
self.tm._set_window_drop_tab_target()
self.assertIs(self.tm.drag_hover, hover)
self.add_timer.assert_called_once()
self.remove_timer.assert_not_called()
def test_changing_targets_restarts_hover_and_ignores_stale_timer(self):
self.hover()
first_callback = self.add_timer.call_args.args[0]