Fix tab activity tracking not working unless there is some other activity in tab bar as well
Fixes #3571
This commit is contained in:
parent
4dcccc553c
commit
5cf228e362
@ -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]
|
||||
----------------------
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user