hook up focus changes to Terminator so it can update all the titlebars

This commit is contained in:
Chris Jones 2009-10-09 00:22:01 +01:00
parent 9d6b961fc3
commit 49f374e3b2
2 changed files with 9 additions and 1 deletions

View File

@ -105,4 +105,10 @@ class Terminator(Borg):
def ungroup_tab(self, widget):
"""Ungroup all the terminals in a tab"""
pass
def focus_changed(self, widget):
"""We just moved focus to a new terminal"""
for terminal in self.terminals:
terminal.titlebar.update()
return
# vim: set expandtab ts=4 sw=4:

View File

@ -46,6 +46,7 @@ class Terminal(gtk.VBox):
'split-vert': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
'tab-new': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
'tab-top-new': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
'focus-in': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
}
TARGET_TYPE_VTE = 8
@ -78,6 +79,7 @@ class Terminal(gtk.VBox):
self.connect('enumerate', self.terminator.do_enumerate)
self.connect('group-tab', self.terminator.group_tab)
self.connect('ungroup-tab', self.terminator.ungroup_tab)
self.connect('focus-in', self.terminator.focus_changed)
self.matches = {}
@ -230,7 +232,6 @@ class Terminal(gtk.VBox):
self.vte.connect('window-title-changed', lambda x:
self.emit('title-change', self.get_window_title()))
self.vte.connect('grab-focus', self.on_vte_focus)
self.vte.connect('focus-out-event', self.on_vte_focus_out)
self.vte.connect('focus-in-event', self.on_vte_focus_in)
self.vte.connect('resize-window', self.on_resize_window)
self.vte.connect('size-allocate', self.on_vte_size_allocate)
@ -477,6 +478,7 @@ class Terminal(gtk.VBox):
pass
def on_vte_focus_in(self, widget, event):
self.emit('focus-in')
pass
def on_edit_done(self, widget):