mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 10:12:17 +02:00
Allow very long middle clicks to close tabs
This commit is contained in:
@@ -998,8 +998,7 @@ class TabManager: # {{{
|
|||||||
self.set_active_tab_idx(i)
|
self.set_active_tab_idx(i)
|
||||||
elif button == GLFW_MOUSE_BUTTON_MIDDLE and action == GLFW_RELEASE and self.recent_mouse_events:
|
elif button == GLFW_MOUSE_BUTTON_MIDDLE and action == GLFW_RELEASE and self.recent_mouse_events:
|
||||||
p = self.recent_mouse_events[-1]
|
p = self.recent_mouse_events[-1]
|
||||||
ci = get_click_interval()
|
if p.button == button and p.action == GLFW_PRESS and p.tab_idx == i:
|
||||||
if p.button == button and p.action == GLFW_PRESS and p.tab_idx == i and now - p.at <= ci:
|
|
||||||
tab = self.tabs[i]
|
tab = self.tabs[i]
|
||||||
get_boss().close_tab(tab)
|
get_boss().close_tab(tab)
|
||||||
self.recent_mouse_events.append(TabMouseEvent(button, modifiers, action, now, i))
|
self.recent_mouse_events.append(TabMouseEvent(button, modifiers, action, now, i))
|
||||||
|
|||||||
Reference in New Issue
Block a user