diff --git a/terminatorlib/container.py b/terminatorlib/container.py index e9b05fd9..d34c5347 100755 --- a/terminatorlib/container.py +++ b/terminatorlib/container.py @@ -195,7 +195,9 @@ the %s will also close all terminals within it.') % (reqtype, reqtype)) def get_visible_terminals(self): """Walk the widget tree to find all of the visible terminals. That is, any terminals which are not hidden in another Notebook pane""" - maker = Factory() + if not hasattr(self, 'cached_maker'): + self.cached_maker = Factory() + maker = self.cached_maker terminals = {} for child in self.get_offspring(): diff --git a/terminatorlib/window.py b/terminatorlib/window.py index e1eac66a..1e7cf85d 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -480,7 +480,9 @@ class Window(Container, gtk.Window): """Walk down the widget tree to find all of the visible terminals. Mostly using Container::get_visible_terminals()""" terminals = {} - maker = Factory() + if not hasattr(self, 'cached_maker'): + self.cached_maker = Factory() + maker = self.cached_maker child = self.get_child() if not child: @@ -511,7 +513,9 @@ class Window(Container, gtk.Window): def set_rough_geometry_hints(self): """Walk all the terminals along the top and left edges to fake up how many columns/rows we sort of have""" - maker = Factory() + if not hasattr(self, 'cached_maker'): + self.cached_maker = Factory() + maker = self.cached_maker if maker.isinstance(self.get_child(), 'Notebook'): dbg("We don't currently support geometry hinting with tabs") return