From 8ff0dfa72a208e736af49aa653809471c001c849 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 20 Oct 2008 09:29:47 +0100 Subject: [PATCH] Don't run the full title change handler every time if the title hasn't changed --- terminatorlib/terminatorterm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/terminatorlib/terminatorterm.py b/terminatorlib/terminatorterm.py index 6b542a56..d1561811 100755 --- a/terminatorlib/terminatorterm.py +++ b/terminatorlib/terminatorterm.py @@ -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)