From 7c73aaa0802be8ae498b2d0dc8361fc4ca3d27ac Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Mon, 13 Feb 2017 13:03:57 +0100 Subject: [PATCH] Fix for strange race condition where every so often get_length returns 1. --- terminatorlib/paned.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index f09f7f1f..cc2bc59a 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -484,7 +484,11 @@ class Paned(Container): return float(position) / float(non_separator_size) def set_position_by_ratio(self): - handle_size = handle_size = self.get_handlesize() + # Fix for strange race condition where every so often get_length returns 1. (LP:1655027) + while self.terminator.doing_layout and self.get_length() == 1: + while Gtk.events_pending(): + Gtk.main_iteration() + self.set_pos(self.position_by_ratio(self.get_length(), self.get_handlesize(), self.ratio)) def set_position(self, pos):