From 8e034f26d81087858a25b15c779c536887fc95a3 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 19 Apr 2015 22:55:57 +0000 Subject: hide empty space < 2MB, we have such holes due to alignment (mga#15733) --- perl-install/NEWS | 1 + perl-install/diskdrake/hd_gtk.pm | 4 +++- perl-install/fs/partitioning_wizard.pm | 4 +++- perl-install/install/NEWS | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/perl-install/NEWS b/perl-install/NEWS index f9f2574a7..07e0246e4 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -3,6 +3,7 @@ disk, not the last one across all disks (mga#15589) o suggest up to 20GB/20% of the windows partition (whichever is larger), previously 6GB/10% (mga#15589) + o hide empty space < 2MB, we have such holes due to alignment (mga#15733) - ugtk2, ugtk3, harddrake2: o do not "restore" mouse cursor on the root window, we haven't set it to 'wait' since 2005 and this causes a crash if we don't own it (mga#15729). diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm index 0fd5c598a..93625e921 100644 --- a/perl-install/diskdrake/hd_gtk.pm +++ b/perl-install/diskdrake/hd_gtk.pm @@ -324,7 +324,7 @@ sub create_automatic_notebooks { # parts: helpers ################################################################################ sub create_buttons4partitions { - my ($kind, $totalsectors, @parts) = @_; + my ($kind, $totalsectors, @all_parts) = @_; if ($w->{window}->get_window) { my $windowwidth = $w->{window}->get_allocated_width; @@ -332,6 +332,8 @@ sub create_buttons4partitions { $width = $windowwidth - first(get_action_box_size()) - 25; } + my @parts = grep { $_->{size} > MB(2) || !isEmpty($_) } @all_parts; + my $ratio = $totalsectors ? ($width - @parts * $minwidth) / $totalsectors : 1; my $i = 1; while ($i < 30) { diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm index a30fa67d0..316e2f1b9 100644 --- a/perl-install/fs/partitioning_wizard.pm +++ b/perl-install/fs/partitioning_wizard.pm @@ -295,7 +295,9 @@ sub warn_reboot_needed { sub create_display_box { my ($kind, $resize, $fill_empty, $button) = @_; - my @parts = diskdrake::hd_gtk::kind2parts($kind); + # Hide empty space < 2MB, wehave such holes due to alignment + my @parts = grep { $_->{size} > MB(2) || !isEmpty($_) } diskdrake::hd_gtk::kind2parts($kind); + my $totalsectors = diskdrake::hd_gtk::kind2sectors($kind, @parts); my $width = 520; diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 5611c00a4..aa816cc34 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -3,6 +3,7 @@ disk, not the last one across all disks (mga#15589) o suggest up to 20GB/20% of the windows partition (whichever is larger), previously 6GB/10% (mga#15589) + o hide empty space < 2MB, we have such holes due to alignment (mga#15733) - speed up reading of flags from GPT partition table (mga#15621). Version 16.84 - 14 April 2015 -- cgit v1.2.1