Fix rotate terminals under tabs, and (gtk3-only) focus loss on rotate

This commit is contained in:
Stephen Boddy 2015-11-30 16:19:41 +01:00
parent df0d9aa0eb
commit 8c45d97304
1 changed files with 11 additions and 5 deletions

View File

@ -535,7 +535,13 @@ class Window(Container, Gtk.Window):
maker = Factory() maker = Factory()
# collect all paned children in breadth-first order # collect all paned children in breadth-first order
paned = [] paned = []
for child in self.get_children(): 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'): if maker.isinstance(child, 'Paned'):
paned.append(child) paned.append(child)
for p in paned: for p in paned:
@ -546,10 +552,10 @@ class Window(Container, Gtk.Window):
for p in paned: for p in paned:
p.rotate(widget, clockwise) p.rotate(widget, clockwise)
self.show_all() self.show_all()
widget.grab_focus()
while Gtk.events_pending(): while Gtk.events_pending():
Gtk.main_iteration_do(False) Gtk.main_iteration_do(False)
widget.grab_focus()
self.set_pos_by_ratio = False self.set_pos_by_ratio = False
def get_visible_terminals(self): def get_visible_terminals(self):