diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index f3747c1c..3b2e653e 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -12,7 +12,7 @@ from factory import Factory from container import Container from editablelabel import EditableLabel from translation import _ -from util import err, dbg, get_top_window, enumerate_descendants +from util import err, dbg, enumerate_descendants class Notebook(Container, gtk.Notebook): """Class implementing a gtk.Notebook container""" @@ -173,7 +173,7 @@ class Notebook(Container, gtk.Notebook): def newtab(self, debugtab=False, widget=None, cwd=None): """Add a new tab, optionally supplying a child widget""" maker = Factory() - top_window = get_top_window(self) + top_window = self.get_toplevel() if not widget: widget = maker.make('Terminal') diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index 5c43d00d..1b300450 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -7,7 +7,7 @@ variants""" import gobject import gtk -from util import dbg, err, get_top_window +from util import dbg, err from terminator import Terminator from factory import Factory from container import Container @@ -86,7 +86,7 @@ class Paned(Container): raise ValueError('Paned widgets can only have two children') if maker.isinstance(widget, 'Terminal'): - top_window = get_top_window(self) + top_window = self.get_toplevel() signals = {'close-term': self.wrapcloseterm, 'split-horiz': self.split_horiz, 'split-vert': self.split_vert, diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 3d5869c2..40b3f5a2 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -15,7 +15,7 @@ import pango import subprocess import urllib -from util import dbg, err, gerr, get_top_window +from util import dbg, err, gerr import util from config import Config from cwd import get_default_cwd @@ -960,7 +960,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) def ensure_visible_and_focussed(self): """Make sure that we're visible and focussed""" - window = util.get_top_window(self) + window = self.get_toplevel() topchild = window.get_child() maker = Factory() @@ -1005,7 +1005,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) self.titlebar.update_terminal_size(self.vte.get_column_count(), self.vte.get_row_count()) if self.vte.window and self.config['geometry_hinting']: - window = util.get_top_window(self) + window = self.get_toplevel() window.set_rough_geometry_hints() def on_vte_notify_enter(self, term, event): @@ -1078,7 +1078,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) """Determine if we are a zoomed terminal""" prop = None parent = self.get_parent() - window = get_top_window(self) + window = self.get_toplevel() try: prop = window.get_property('term-zoomed') @@ -1312,7 +1312,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) def on_beep(self, widget): """Set the urgency hint for our window""" if self.config['urgent_bell'] == True: - window = util.get_top_window(self) + window = self.get_toplevel() window.set_urgency_hint(True) if self.config['icon_bell'] == True: self.titlebar.icon_bell() diff --git a/terminatorlib/util.py b/terminatorlib/util.py index 872b76d0..c2af1cc4 100755 --- a/terminatorlib/util.py +++ b/terminatorlib/util.py @@ -89,14 +89,6 @@ def has_ancestor(widget, wtype): return(True) return(False) -def get_top_window(widget): - """Return the Window instance a widget belongs to""" - parent = widget.get_parent() - while parent: - widget = parent - parent = widget.get_parent() - return(widget) - def path_lookup(command): '''Find a command in our path''' if os.path.isabs(command):