From 270d7af054112aeabcedde0474ab863843520268 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 31 Jul 2002 20:06:12 +0000 Subject: (choose_gtk): ensure the response is one of @resolutions (so that Y and maybe bios is kept) (to_string): created --- perl-install/Xconfig/resolution_and_depth.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'perl-install/Xconfig/resolution_and_depth.pm') diff --git a/perl-install/Xconfig/resolution_and_depth.pm b/perl-install/Xconfig/resolution_and_depth.pm index 75639d9d0..816af1916 100644 --- a/perl-install/Xconfig/resolution_and_depth.pm +++ b/perl-install/Xconfig/resolution_and_depth.pm @@ -66,6 +66,13 @@ sub size2default_resolution { $monitorSize2resolution{round($size)} || ($size < 13 ? "640x480" : "1600x1200"); } +sub to_string { + my ($resolution) = @_; + $resolution or return; + + sprintf("%sx%s %dbpp", @$resolution{'X', 'Y', 'Depth'}); +} + sub allowed { my ($card) = @_; @@ -280,7 +287,7 @@ sub choose_gtk { $x_res_combo->entry->set_text($chosen_x_res . "x" . $x_res2y_res{$chosen_x_res}); $W->main or return; - { X => $chosen_x_res, Depth => $chosen_Depth }; + first(grep { $_->{X} == $chosen_x_res && $_->{Depth} == $chosen_Depth } @resolutions); } 1; -- cgit v1.2.1