From 8dc97f37f94291828eed9dd7b625bd8f44b2fe25 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 09:05:39 +0000 Subject: [PATCH] Force tab bar visible when dragging a window over an OS window Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/93865645-4c0b-4371-9ed0-c58bdfd4e07d Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com> --- docs/changelog.rst | 2 ++ kitty/tabs.py | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 03ecc1cc4..5750a7551 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -203,6 +203,8 @@ Detailed list of changes - Window drag: Use a screenshot of the window contents as the drag thumbnail, just like tab dragging does +- Window drag: Force the tab bar to be visible when dragging a window over an OS window, so the window can be dropped onto a tab + 0.46.2 [2026-03-21] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/tabs.py b/kitty/tabs.py index a1256843b..a19558ba7 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -1144,6 +1144,7 @@ class TabManager: # {{{ tab_being_dropped: TabBeingDropped | None = None window_being_dropped: WindowBeingDropped | None = None window_drag_target_tab_id: int = 0 + window_drag_over_me: bool = False def __init__(self, os_window_id: int, args: CLIOptions, wm_class: str, wm_name: str, startup_session: SessionType | None = None): self.os_window_id = os_window_id @@ -1243,6 +1244,8 @@ class TabManager: # {{{ def tab_bar_should_be_visible(self) -> bool: if self.tab_being_dropped is not None: return True # keep tab bar visible in the dest + if self.window_drag_over_me: + return True # keep tab bar visible when a window is being dragged over this OS window count = get_options().tab_bar_min_tabs if count < 1: return True @@ -1929,7 +1932,17 @@ class TabManager: # {{{ if not is_dest: self._set_drag_target_window(0) self._set_drag_target_tab(0) + if self.window_drag_over_me: + self.window_drag_over_me = False + if not self.tab_bar_hidden: + self.layout_tab_bar() + self.resize(only_tabs=True) return + if not self.window_drag_over_me: + self.window_drag_over_me = True + if not self.tab_bar_hidden: + self.layout_tab_bar() + self.resize(only_tabs=True) from .fast_data_types import viewport_for_window tab_bar = viewport_for_window(self.os_window_id)[1] if tab_bar.left <= x < tab_bar.right and tab_bar.top <= y < tab_bar.bottom: