From 6e9ef142b7c16d8a777b9492a222227810f09778 Mon Sep 17 00:00:00 2001 From: Vulcalien Date: Tue, 1 Jun 2021 20:40:58 +0200 Subject: [PATCH] Fixed issue #433 (layout sometimes ignores ratio) --- terminatorlib/paned.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index f13b2cbd..3f6d7f1d 100644 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -488,11 +488,15 @@ class Paned(Container): return float(position) / float(non_separator_size) def set_position_by_ratio(self): + # For reasons unknown to me, self.ratio often changes when the following loop is executed + ratio = self.ratio + # 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.ratio = ratio self.set_pos(self.position_by_ratio(self.get_length(), self.get_handlesize(), self.ratio)) def set_position(self, pos):