Skip to content

Commit

Permalink
Merge pull request #442 from Vulcalien/master
Browse files Browse the repository at this point in the history
Fixed issue #433 (layout sometimes ignores ratio)
  • Loading branch information
mattrose authored Jun 1, 2021
2 parents 8f52cd0 + 6e9ef14 commit 0133361
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions terminatorlib/paned.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,15 @@ def ratio_by_position(self, total_size, handle_size, position):
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):
Expand Down

0 comments on commit 0133361

Please sign in to comment.