From 6beaa26277599ce85faa70e6a88e2c525bc5c77b Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Mon, 30 Nov 2015 16:19:39 +0100 Subject: [PATCH] Fix rotate terminals under tabs --- terminatorlib/notebook.py | 8 +++++--- terminatorlib/window.py | 12 +++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index 628696e3..8ac46aa3 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -297,9 +297,11 @@ class Notebook(Container, gtk.Notebook): break self.set_tab_label(widget, label) - self.set_tab_label_packing(term_widget, not self.config['scroll_tabbar'], - not self.config['scroll_tabbar'], - gtk.PACK_START) + gobject.idle_add(self.set_tab_label_packing, + term_widget, + not self.config['scroll_tabbar'], + not self.config['scroll_tabbar'], + gtk.PACK_START) self.set_tab_reorderable(widget, True) self.set_current_page(tabpos) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index de9dd757..e33191e9 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -536,9 +536,15 @@ class Window(Container, gtk.Window): maker = Factory() # collect all paned children in breadth-first order paned = [] - for child in self.get_children(): - if maker.isinstance(child, 'Paned'): - paned.append(child) + child = self.get_child() + + # If our child is a Notebook, reset to work from its visible child + if maker.isinstance(child, 'Notebook'): + pagenum = child.get_current_page() + child = child.get_nth_page(pagenum) + + if maker.isinstance(child, 'Paned'): + paned.append(child) for p in paned: for child in p.get_children(): if child not in paned and maker.isinstance(child, 'Paned'):