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) appears in the config file (Steve Boddy, LP#1262709)
* Fix the way alternatives are set up that cures blurry/incorrect * Fix the way alternatives are set up that cures blurry/incorrect
icons in task switchers (Steve Boddy, LP#1067287) 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: terminator 0.97:
* Allow font dimming in inactive terminals * Allow font dimming in inactive terminals

View File

@ -244,6 +244,21 @@ class Paned(Container):
if self.closeterm(widget): if self.closeterm(widget):
# At this point we only have one child, which is the surviving term # At this point we only have one child, which is the surviving term
sibling = self.children[0] 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) self.remove(sibling)
metadata = None metadata = None
@ -253,6 +268,7 @@ class Paned(Container):
parent.remove(self) parent.remove(self)
self.cnxids.remove_all() self.cnxids.remove_all()
parent.add(sibling, metadata) parent.add(sibling, metadata)
if focus_sibling:
sibling.grab_focus() sibling.grab_focus()
else: else:
dbg("Paned::wrapcloseterm: self.closeterm failed") dbg("Paned::wrapcloseterm: self.closeterm failed")