Fix window drag to + button failing to create new tab with single tab (issue #10222)

This commit is contained in:
copilot-swe-agent[bot] 2026-07-04 06:38:02 +00:00 • committed by GitHub
parent 89781759e4
commit d0da0d4c53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -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]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -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: