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,9 +535,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'):
@ -546,10 +552,10 @@ class Window(Container, Gtk.Window):
for p in paned:
p.rotate(widget, clockwise)
self.show_all()
widget.grab_focus()
while Gtk.events_pending():
Gtk.main_iteration_do(False)
widget.grab_focus()
self.set_pos_by_ratio = False
def get_visible_terminals(self):