summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-11-27 16:51:55 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-11-28 14:19:29 +0100
commite779a9401a2971e0338fdf3e7dffaa60629d3b28 (patch)
tree015526bac5c203351b7362a4136f41022dde2635
parentac770b60cddb20587a87bafb35b61c6810a0bf42 (diff)
downloaddrakx-e779a9401a2971e0338fdf3e7dffaa60629d3b28.tar
drakx-e779a9401a2971e0338fdf3e7dffaa60629d3b28.tar.gz
drakx-e779a9401a2971e0338fdf3e7dffaa60629d3b28.tar.bz2
drakx-e779a9401a2971e0338fdf3e7dffaa60629d3b28.tar.xz
drakx-e779a9401a2971e0338fdf3e7dffaa60629d3b28.zip
prevent looping forever when sizing partition tabs
spot while trying to reproduce mga#11779 this code has always been tricky and has bugs since introduced (see eg: resizing occuring when switching partition tabs)
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/diskdrake/hd_gtk.pm3
2 files changed, 4 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 63cae8189..a1bf32067 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -4,6 +4,8 @@
- Banners:
o align text to left instead of centering it
o text is rendered as blue again
+- diskdrake:
+ o prevent looping forever when sizing partition tabs
Version 16.0 - 23 November 2013
diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm
index 583df7ae2..d98f25cac 100644
--- a/perl-install/diskdrake/hd_gtk.pm
+++ b/perl-install/diskdrake/hd_gtk.pm
@@ -324,7 +324,8 @@ sub create_buttons4partitions {
$width = $w->{window}->get_allocated_width - first(get_action_box_size()) - 25 if $w->{window}->get_window;
my $ratio = $totalsectors ? ($width - @parts * $minwidth) / $totalsectors : 1;
- while (1) {
+ my $i = 1;
+ while ($i < 30) {
my $totalwidth = sum(map { $_->{size} * $ratio + $minwidth } @parts);
$totalwidth <= $width and last;
$ratio /= $totalwidth / $width * 1.1;