From 50cc4f66309de294343d81ff82646d00ad5d74a5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 31 Mar 2026 16:15:24 +0530 Subject: [PATCH] Also check distance between clicks when detecting double click --- kitty/tabs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty/tabs.py b/kitty/tabs.py index bad97c67f..f44e1d3b2 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -112,7 +112,8 @@ class MouseEvents(deque[MouseEvent]): def click_count(self, button: int = GLFW_MOUSE_BUTTON_LEFT) -> Literal[0, 1, 2]: if len(self) > 1 and self[-1].button == button and self[-1].is_click(self[-2]): - if len(self) > 3 and self[-3].is_click(self[-4]) and self[-1].at - self[-4].at <= 2 * get_click_interval(): + if len(self) > 3 and self[-3].is_click(self[-4]) and \ + self[-1].at - self[-4].at <= 2 * get_click_interval() and self[-2].distance_squared(self[-3]) < 2: return 2 return 1 return 0