Fix tab activity tracking not working unless there is some other activity in tab bar as well

Fixes #3571
This commit is contained in:
Kovid Goyal 2021-05-05 14:23:27 +05:30
parent 4dcccc553c
commit 5cf228e362
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
5 changed files with 17 additions and 0 deletions

View File

@ -18,6 +18,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- macOS: Fix Spotlight search of global menu not working in non-English locales
(:pull:`3567`)
- Fix tab activity symbol not appearing if no other changes happen in tab bar even when
there is activity in a tab (:iss:`3571`)
0.20.2 [2021-04-28]
----------------------

View File

@ -768,6 +768,12 @@ class Boss:
cocoa_set_menubar_title(w.title or '')
tm.mark_tab_bar_dirty()
def on_activity_since_last_focus(self, window: Window) -> None:
os_window_id = window.os_window_id
tm = self.os_window_map.get(os_window_id)
if tm is not None:
tm.mark_tab_bar_dirty()
def update_tab_bar_data(self, os_window_id: int) -> None:
tm = self.os_window_map.get(os_window_id)
if tm is not None:

View File

@ -571,6 +571,7 @@ screen_draw(Screen *self, uint32_t och, bool from_input_stream) {
if (is_ignored_char(och)) return;
if (!self->has_activity_since_last_focus && !self->has_focus) {
self->has_activity_since_last_focus = true;
CALLBACK("on_activity_since_last_focus", NULL);
}
uint32_t ch = och < 256 ? self->g_charset[och] : och;
bool is_cc = is_combining_char(ch);

View File

@ -612,6 +612,10 @@ class Window:
def has_activity_since_last_focus(self) -> bool:
return self.screen.has_activity_since_last_focus()
def on_activity_since_last_focus(self) -> None:
if self.opts.tab_activity_symbol:
get_boss().on_activity_since_last_focus(self)
def on_bell(self) -> None:
if self.opts.command_on_bell and self.opts.command_on_bell != ['none']:
import shlex

View File

@ -51,6 +51,9 @@ class Callbacks:
self.notifications = []
self.open_urls = []
def on_activity_since_last_focus(self) -> None:
pass
def filled_line_buf(ynum=5, xnum=5, cursor=Cursor()):
ans = LineBuf(ynum, xnum)