add a little safety

This commit is contained in:
Chris Jones 2009-12-02 22:48:12 +00:00
parent 80ff07095a
commit 9b8394b701
2 changed files with 5 additions and 1 deletions

View File

@ -871,7 +871,7 @@ class Terminator:
self.on_destroy_event (parent, gtk.gdk.Event (gtk.gdk.DESTROY))
return True
if isinstance (parent, gtk.Paned):
elif isinstance (parent, gtk.Paned):
index = self.term_list.index (widget)
grandparent = parent.get_parent ()
@ -943,6 +943,8 @@ class Terminator:
gdparent.pack2(sibling)
if isinstance(sibling, TerminatorTerm) and sibling.conf.titlebars and sibling.conf.extreme_tabs:
sibling._titlebox.show()
else:
err('Attempting to remove terminal from unknown parent: %s' % parent)
if self.conf.focus_on_close == 'prev' or ( self.conf.focus_on_close == 'auto' and focus_on_close == 'prev'):
if index == 0: index = 1
self.term_list[index - 1]._vte.grab_focus ()

View File

@ -1244,6 +1244,8 @@ text/plain
'''Returns Gdk.Window.get_position(), pixel-based cursor position,
and Gdk.Window.get_geometry()'''
reply = dict()
if not self._vte.window:
return reply
x, y = self._vte.window.get_origin ()
reply.setdefault('origin_x',x)
reply.setdefault('origin_y',y)