From d0da0d4c530c64883f768d33190f1de087d34b6b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Jul 2026 06:38:02 +0000 Subject: [PATCH] Fix window drag to + button failing to create new tab with single tab (issue #10222) --- docs/changelog.rst | 2 ++ kitty/tabs.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 8141ff4b1..22f59395e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -200,6 +200,8 @@ Detailed list of changes - Fix superfluous margin visible to the left and right of the tab bar when :opt:`background_opacity` is less than one and the window width is not a multiple of the cell width (:iss:`10212`) +- Fix dragging a window title bar to the "+" button failing to create a new tab when there is only a single tab (:iss:`10222`) + 0.47.4 [2026-06-15] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/tabs.py b/kitty/tabs.py index b42c3cdf1..e1e17f901 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -2026,6 +2026,12 @@ class TabManager: # {{{ def on_window_drop(self, x: int, y: int, window_id: int) -> None: from .fast_data_types import cell_size_for_window, viewport_for_window boss = get_boss() + # A window is being dropped on this tab manager, so the tab bar must have been + # visible to the user (showing the "+" button). Ensure it stays visible for the + # drop position calculation. This is needed because on_drag_source_finished can + # run before the on_drop data transfer completes, clearing window_drag_over_me + # and hiding the tab bar for the single-tab case before we get here. + self.window_drag_over_me = True self._clear_force_show_title_bars() w = boss.window_id_map.get(window_id) if w is None: