diff --git a/docs/changelog.rst b/docs/changelog.rst index 1742b74b6..e11c93ccd 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -18,6 +18,9 @@ To update |kitty|, :doc:`follow the instructions `. - 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] ---------------------- diff --git a/kitty/boss.py b/kitty/boss.py index cc282a9fd..d89a1418e 100755 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -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: diff --git a/kitty/screen.c b/kitty/screen.c index 99b957973..6a2dd0d80 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -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); diff --git a/kitty/window.py b/kitty/window.py index ce82a9a47..439f5bbd6 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -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 diff --git a/kitty_tests/__init__.py b/kitty_tests/__init__.py index 5c0c2f465..f141b3940 100644 --- a/kitty_tests/__init__.py +++ b/kitty_tests/__init__.py @@ -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)