Fix the tab switching if a terminal on another tab exits

This commit is contained in:
Stephen Boddy 2015-08-27 21:20:19 +02:00
parent 3a07b6e53c
commit 3d85444903
2 changed files with 19 additions and 1 deletions

View File

@ -137,6 +137,8 @@ terminator trunk:
appears in the config file (Steve Boddy, LP#1262709)
* Fix the way alternatives are set up that cures blurry/incorrect
icons in task switchers (Steve Boddy, LP#1067287)
* Fix the tab switching if a terminal on another tab exits (Steve
Boddy, LP#943311)
terminator 0.97:
* Allow font dimming in inactive terminals

View File

@ -244,6 +244,21 @@ class Paned(Container):
if self.closeterm(widget):
# At this point we only have one child, which is the surviving term
sibling = self.children[0]
focus_sibling = True
if self.get_toplevel().is_child_notebook():
notebook = self.get_toplevel().get_children()[0]
tabnum = notebook.page_num_descendant(widget)
nth_page = notebook.get_nth_page(tabnum)
if notebook.last_active_term[nth_page] == widget.uuid:
notebook.set_last_active_term(sibling.uuid)
notebook.clean_last_active_term()
self.get_toplevel().last_active_term = None
if notebook.get_current_page() != tabnum:
focus_sibling = False
elif self.get_toplevel().last_active_term != widget.uuid:
focus_sibling = False
self.remove(sibling)
metadata = None
@ -253,7 +268,8 @@ class Paned(Container):
parent.remove(self)
self.cnxids.remove_all()
parent.add(sibling, metadata)
sibling.grab_focus()
if focus_sibling:
sibling.grab_focus()
else:
dbg("Paned::wrapcloseterm: self.closeterm failed")