mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-09 05:35:19 +02:00
Show a bell on the tab if a bell occurs in one of the windows in the tab and the window is not the currently focused window. Fixes #514
This commit is contained in:
@@ -90,6 +90,7 @@ class Window:
|
||||
|
||||
def __init__(self, tab, child, opts, args, override_title=None):
|
||||
self.action_on_close = None
|
||||
self.needs_attention = False
|
||||
self.override_title = override_title
|
||||
self.overlay_window_id = None
|
||||
self.overlay_for = None
|
||||
@@ -214,6 +215,7 @@ class Window:
|
||||
|
||||
def focus_changed(self, focused):
|
||||
if focused:
|
||||
self.needs_attention = False
|
||||
if self.screen.focus_tracking_enabled:
|
||||
self.screen.send_escape_code_to_child(CSI, 'I')
|
||||
else:
|
||||
@@ -228,6 +230,17 @@ class Window:
|
||||
def icon_changed(self, new_icon):
|
||||
pass # TODO: Implement this
|
||||
|
||||
@property
|
||||
def is_active(self):
|
||||
return get_boss().active_window is self
|
||||
|
||||
def on_bell(self):
|
||||
if not self.is_active:
|
||||
self.needs_attention = True
|
||||
tab = self.tabref()
|
||||
if tab is not None:
|
||||
tab.on_bell(self)
|
||||
|
||||
def change_titlebar_color(self):
|
||||
val = self.opts.macos_titlebar_color
|
||||
if val:
|
||||
|
||||
Reference in New Issue
Block a user