Don't run the full title change handler every time if the title hasn't changed

This commit is contained in:
Chris Jones 2008-10-20 09:29:47 +01:00
parent 91b8527e2e
commit 8ff0dfa72a
1 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,7 @@ class TerminatorTerm (gtk.VBox):
self.terminator = terminator
self.conf = terminator.conf
self.command = command
self._oldtitle = ""
self.cwd = cwd or os.getcwd();
if not os.path.exists(self.cwd) or not os.path.isdir(self.cwd):
@ -1053,6 +1054,11 @@ text/plain
def on_vte_title_change(self, vte):
title = self.get_window_title(vte)
if title == self._oldtitle:
# Title hasn't changed, don't bother doing anything
return
self._oldtitle = title
if self.conf.titletips:
vte.set_property ("has-tooltip", True)
vte.set_property ("tooltip-text", title)