diff --git a/terminatorlib/container.py b/terminatorlib/container.py index 59acdb3b..fba84fa4 100755 --- a/terminatorlib/container.py +++ b/terminatorlib/container.py @@ -256,6 +256,9 @@ the %s will also close all terminals within it.') % (reqtype, reqtype)) if hasattr(position, '__iter__'): position = ':'.join([str(x) for x in position]) layout['position'] = position + + if hasattr(self, 'ratio'): + layout['ratio'] = self.ratio if hasattr(self, 'get_size'): layout['size'] = self.get_size() diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index 3a3eafab..119b437d 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -350,9 +350,10 @@ class Paned(Container): self.get_child1().create_layout(children[keys[0]]) self.get_child2().create_layout(children[keys[1]]) - # Store the position for later - if layout['position']: - self.position = int(layout['position']) + # Set the position with ratio. For some reason more reliable than by pos. + if layout.has_key('ratio'): + self.ratio = float(layout['ratio']) + self.set_position_by_ratio() def grab_focus(self): """We don't want focus, we want a Terminal to have it""" diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index c4f9fce4..831bd094 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -262,7 +262,6 @@ class Terminator(Borg): raise(ValueError) dbg('Creating a window') window, terminal = self.new_window() - window.create_layout(layout[windef]) if layout[windef].has_key('position'): parts = layout[windef]['position'].split(':') if len(parts) == 2: @@ -275,6 +274,7 @@ class Terminator(Borg): window.resize(winx, winy) if layout[windef].has_key('title'): window.title.force_title(layout[windef]['title']) + window.create_layout(layout[windef]) def layout_done(self): """Layout operations have finished, record that fact"""