Fix for strange race condition where every so often get_length returns 1.

This commit is contained in:
Stephen Boddy 2017-02-13 13:03:57 +01:00
parent 52904ef561
commit 7c73aaa080

View File

@ -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):