From c99f7c554f6614ec91e3b442fa211f16db835a7f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 29 Aug 2020 18:12:17 +0530 Subject: [PATCH] Fix unfocused windows in which a bell occurs not changing their border color to red until a relayout --- docs/changelog.rst | 3 +++ kitty/window.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 06def6f38..b5095303e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -30,6 +30,9 @@ To update |kitty|, :doc:`follow the instructions `. wheel events to scroll the scrollback buffer, instead send them to the program (:iss:`2939`) +- Fix unfocused windows in which a bell occurs not changing their border color + to red until a relayout + 0.18.3 [2020-08-11] ------------------- diff --git a/kitty/window.py b/kitty/window.py index 6c9a4a929..a631180b0 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -489,9 +489,14 @@ class Window: return call_watchers(weakref.ref(self), 'on_focus_change', {'focused': focused}) if focused: + changed = self.needs_attention self.needs_attention = False if self.screen.focus_tracking_enabled: self.screen.send_escape_code_to_child(CSI, 'I') + if changed: + tab = self.tabref() + if tab is not None: + tab.relayout_borders() else: if self.screen.focus_tracking_enabled: self.screen.send_escape_code_to_child(CSI, 'O') @@ -516,9 +521,12 @@ class Window: env['KITTY_CHILD_CMDLINE'] = ' '.join(map(shlex.quote, self.child.cmdline)) subprocess.Popen(self.opts.command_on_bell, env=env, cwd=self.child.foreground_cwd) if not self.is_active: + changed = not self.needs_attention self.needs_attention = True tab = self.tabref() if tab is not None: + if changed: + tab.relayout_borders() tab.on_bell(self) def change_titlebar_color(self) -> None: