diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 611e9a0e..85313a81 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -982,6 +982,10 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) """Inform other parts of the application when focus is received""" self.emit('focus-in') + def on_window_focus_out(self): + """Update our UI when the window loses focus""" + self.titlebar.update('window-focus-out') + def scrollbar_jump(self, position): """Move the scrollbar to a particular row""" self.scrollbar.set_value(position) diff --git a/terminatorlib/titlebar.py b/terminatorlib/titlebar.py index 1921535b..5f26b50d 100755 --- a/terminatorlib/titlebar.py +++ b/terminatorlib/titlebar.py @@ -127,7 +127,13 @@ class Titlebar(gtk.EventBox): default_bg = True group_fg = self.config['title_inactive_fg_color'] group_bg = self.config['title_inactive_bg_color'] + elif other == 'window-focus-out': + title_fg = self.config['title_inactive_fg_color'] + title_bg = self.config['title_inactive_bg_color'] + icon = '_receive_off' + default_bg = True else: + # We're the active terminal title_fg = self.config['title_transmit_fg_color'] title_bg = self.config['title_transmit_bg_color'] if terminator.groupsend == terminator.groupsend_type['all']: diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 42c51b2f..88712ce0 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -186,8 +186,8 @@ class Window(Container, gtk.Window): def on_focus_out(self, window, event): """Focus has left the window""" - # FIXME: Cause the terminal titlebars to update here - pass + for terminal in self.get_visible_terminals(): + terminal.on_window_focus_out() def on_focus_in(self, window, event): """Focus has entered the window"""