From 53f832a20a71bc62159c4f7586b370e6526f6477 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 28 Mar 2026 17:15:24 +0530 Subject: [PATCH] ... --- kitty/tabs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kitty/tabs.py b/kitty/tabs.py index 7df7b153e..3d072b17e 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -1753,9 +1753,11 @@ def handle_tab_bar_mouse(self, x: float, y: float, button: int, modifiers: int, tab_id_at_x = self.tab_bar.tab_id_at(int(x)) now = monotonic() if tab_id_at_x < 0: # synthetic tab (e.g. "+" new-tab button) - if button == GLFW_MOUSE_BUTTON_LEFT and action == GLFW_RELEASE and self.recent_mouse_events: - if (prev := self.recent_mouse_events[-1]).button == button and prev.action == GLFW_PRESS and prev.tab_id == tab_id_at_x: - self.new_tab() + if ( + button == GLFW_MOUSE_BUTTON_LEFT and action == GLFW_RELEASE and self.recent_mouse_events and + (prev := self.recent_mouse_events[-1]).button == button and prev.action == GLFW_PRESS and prev.tab_id == tab_id_at_x + ): + self.new_tab() else: tab = self.tab_for_id(tab_id_at_x) if tab is None: